You can do it as an include also... create a php file with the cpmfetch code on the main server and do a php include from the other server. That could work.
Otherwise, as the faq said, I don't have much experience with getting that sort of thing running - so YMMV
Hi Vuud,
I tried this approach of using the entire URL in the php "include"but I got an error, whenever I use the complete URL in the "include" statement. This error maybe on account that I did not use it properly [I know I cannot full URL in the usual SSI for html scripts, but I thought I can do that with php "include" -- at least I thought I used full URL in the php "include.]
Being able to include photos the way CPMFetch works in remote (i.e., in another subdomain or domain) non-gallery sites would be a powerful feature of CPMFetch.
Until there is a method to be able to export the result of CPMFetch into "remote" sites outside of the domain where the photogallery and CPMFetch are located, I have to rearrange the entire architecture of the way the photos are stored in my website -- it has to be decentralized rather than in one single subdomain as I originally planned.
The integrated single site location of photos -- outside of any of the photogallery program directory has very important uses. One of them is the ability to use the some photos in multiple (independent) photogalleries. It is also a much simpler way of administering the photos.
cgc0202
N.B.
Maybe I did not understand the suggestion in your previous response correctly. I did create a "test.php" page in the subdomain where the photogallery and the CPMFetch are located. The CPMFetch result displayed properly in the "test.php" page. [Thanks again for the help.]
To illustrate your suggestion, did you mean this? Let us say "test.php" is in "mysite.org/test-files" so that the full URL for "test.php" would be:
http://mysite.org/test-files/test.phpWhen you stated: "...do a php include from the other server", did you mean a script like this:
First Approach
<? php
include '
http://mysite.org/test-files/test.php';?>
I tried that and got this error:
Parse error: parse error, unexpected T_INCLUDE in /home/treasure/public_html/test-fetch.php on line 2
Even if this might work there is one catch: It will require the creation of php files similar to "test.php'". Creation of such files would be no problem if there are only a few; but becomes an issue if there are thousands or more of such files to be created.
Second Approach
I tried another approach where I use the complete URL in the "include" statement itself, for a test file (placed in the other subdomain) that included the Fetch statements, i.e.,
<?php
include "
http://mmedia.treasuresoftheinternet.org/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/ecos201');
$objCpm->cpm_OverridePathToAlbums("/pics");
....
etc. etc.
?>
I got this error:
Fatal error: Cannot instantiate non-existent class: cpm in /home/treasure/public_html/toti-test.php on line 9
whether or not I added "
http://mmedia.treasuresoftheinternet.org" (where the CPMFetch and the gallery are located) also in the
$objCpm = new cpm('/ecos201');
$objCpm->cpm_OverridePathToAlbums("/pics");
although I got more errors without the "
http://mmedia.treasuresoftheinternet.org". So, maybe I am just doing something incorrectly.
Note that the
second approach works if placed in the same subdomain (where there would be no need to add the "
http://mmedia.treasuresoftheinternet.org", so that it would be simply:
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm('/ecos201');
$objCpm->cpm_OverridePathToAlbums("/pics");
....
etc. etc.
?>
If only the Second Approach works in another subdomain, then I can have a centralized subdomain for the multiple photogalleries, as well as an integrated location for all pics.
cgc0202