Stumped. Please help.
Posted: Tue May 27, 2003 5:09 pm
I am useing a very simple php script. In fact I will post the whole thing here.
The script creates an image gallery that is viewable using thumbnails and a slide show format.
Here is my problem:
The script runs perfectly on my own server. However when I publish it on my work server I have problems. First to get the script to work at work I have to link directly to the file. That is I have to link to http://www.minisink.com/highschool/artp ... /index.php (must include the index.php) On my personal server http://www.mcassey.com/images/gallery/bacon/art2/ is sufficient (no index.php needed). This isn't a problem per se because it will load the thumbnails page without a problem. However, when I click on a thumbnail (the second part of the script) nothing happens. Does anyone know why this is?
Here is the difference in the two actual links
my server
work server
Can anyone see a problem? Is it do to a server restriction perhaps? Feel free to check out the pages if it will help make sence of what I am talking about. Right now only the links that I listed are active.
Thanks,
Ognar
P.S. I did not write this script, though I did edit it a bit.
Code: Select all
<?
$album = "Student Work"; //title of your gallery //
$columns = 5; //number of photos in a row //
$thumb_dir = "thumbnails"; //thumbnails location dir //
$scriptname = "index.php"; //name of this file //
//----------------------------------------------------------------------//
echo "<HTML>\n";
echo "<BODY BACKGROUND='../../background.jpg'>\n";
echo "<CENTER>\n\n";
$mydirectory= '.';
$counter=0;
$nbfiles = 0;
$currfile = "";
$fileї0] = "";
$handle=opendir($mydirectory);
if ($home == "")
{echo "<FONT SIZE=5><B>$album</B></FONT><P>\n<TABLE BORDER='0' background='images/rawcanvas.jpg' CELLPADDING='5' CELLSPACING='5'>\n<TR>\n";}
while ($currfile = readdir($handle))
{$extension= strtolower(substr( strrchr( $currfile, "."),1));
if ($extension== "jpg" || $extension== "jpeg")
{$nbfiles++;
$currfile = trim($currfile);
$fileї$nbfiles] = $currfile;
if ($home == "")
{$currthumbfile = $thumb_dir . "/" . $currfile;
echo " <TD ALIGN='CENTER' VALIGN='MIDDLE'><A HREF=?home=1&name=$currfile&nr=$nbfiles><IMG BORDER='0' SRC= $currthumbfile></A></TD>\n";
$counter++;
if ($counter == $columns)
{$counter= 0;echo"</TR>\n";echo"<TR>\n";}}}}
if ($home == "")
{echo"</TR>\n\n";}
closedir($handle);
if ($home == 1)
{if ($nr != 1)
{$prevnumber = $nr - 1;
echo "<A HREF=?home=1&name=$fileї$prevnumber]&nr=$prevnumber><IMG ALT='Previous' BORDER='0' SRC='../../../prev.gif'></A>\n";}
echo "<A HREF=$scriptname><IMG ALT='Thumbnails' BORDER='0' SRC='../../../back.gif'></A>\n";
if ($nr != $nbfiles)
{$nextnumber = $nr + 1;
echo "<A HREF=?home=1&name=$fileї$nextnumber]&nr=$nextnumber><IMG ALT='Next' BORDER='0' SRC='../../../next.gif'></A><p>\n";}
echo "<TABLE BORDER='0' BGCOLOR='#FFFFFF' CELLPADDING='0' CELLSPACING='0'>\n";
echo "<TR><TD><IMG ALT=$nr BORDER='0' SRC=$name></TD></TR></TABLE>\n\n";}
?>
</CENTER>
</BODY>
</HTML>Here is my problem:
The script runs perfectly on my own server. However when I publish it on my work server I have problems. First to get the script to work at work I have to link directly to the file. That is I have to link to http://www.minisink.com/highschool/artp ... /index.php (must include the index.php) On my personal server http://www.mcassey.com/images/gallery/bacon/art2/ is sufficient (no index.php needed). This isn't a problem per se because it will load the thumbnails page without a problem. However, when I click on a thumbnail (the second part of the script) nothing happens. Does anyone know why this is?
Here is the difference in the two actual links
my server
Code: Select all
http://www.mcassey.com/images/gallery/bacon/art2/?home=1&name=SB1.jpg&nr=1Code: Select all
http://www.minisink.com/highschool/artpage/images/gallery/bacon/art2/index.php?home=1&name=sb1.jpg&nr=1Thanks,
Ognar
P.S. I did not write this script, though I did edit it a bit.