View Full Version : PHP photo album, Can getpics script call images from another location?

01-16-2007, 10:18 PM
1) Script Title:
PHP Photo Album Script

2) Script URL (on DD):

3) Describe problem:
First oif all, this is a fantastic script, much quicker than creating galleries in any WYSIWYG program I've come accross.

My problem is, the script, as its shown on DD, requires the getpics script to be in the same folder as the thumbnails.
With my host, or freespace I get from my ISP, I can only run scripts, perl, php etc from my cgi bin, and I can't use images in my cgi bin.

What I want to know, if anyone can help me is, can the script be altered, so that the getpics can call images from another directory, so I could have the getpics script in my cgi bin, calling images from my normal webspace?
If so, what needs to be changed and how.

Many thanks in advance to anyone who can help me with this one.

01-17-2007, 06:57 AM
Certainly. Inside getpics.php, find the line:


And change that to:

$imagesdirpath=$_SERVER['DOCUMENT_ROOT'] . "/phpalbum/"; //server path to your images directory

Where $imagesdirpath=$_SERVER['DOCUMENT_ROOT'] . "/phpalbum/" is the path to your images directory. Just change "/phpalbum" to the full path of your images directory relative to your server's root (ie: mydomain.com).

You may want to read up on PHP's predefined variables (http://ca3.php.net/reserved.variables) to find out the various ways you can retrieve the path to a folder on your server. There are a few ways.

02-12-2007, 09:31 PM
Many thanks for that.

I managed to get it working on a gallery, but I then tried it again in a different page, and instead of displaying images 3x3, it show2s them all in 1 column, but 3 groups of 3. The cell width should be ample to accomidate the images 3 wide.

Any suggestions on how I can fix this would be greatly appreciatted.
I have tried it on the following URLS, and can't get it to work

Could it conflict with using "include" scripts in PHP?