i have created an image gallery using php. everything if fine except that the links to the full images are not working. www.nitesh.x10hosting.com/gallery.php the thumbnails are linked to the full image , however this does not work as expected.
Your images are linked to gallery.php?album_name=illusions&max=10 and so they don't show complete images when gallery.php shows with the above parameter
i changed the links of some of the images to absolute ones(see gallery illusion) , but even that did not work. the problem seems to be something else as when i put a "image" link on that page to one of the images it worked fine,but the thumbnails do not link. one more thing i would like to add is that the links work fine in IE6 and OPERA but not in firefox and safari
here's the portion of the code(gallery.php) that generates the images and links PHP: if(!$_GET['album_name']) {} else { $album_name=$_GET['album_name']; $max=$_GET['max']; if(!isset($_GET['pic_num'])) $_GET['pic_num']=0; $pic_num=$_GET['pic_num']; require('db_login_details.php'); $connection=mysql_connect($db_hostname, $db_username, $db_password); if(!$connection) die("Failed to connect to database".mysql_error()); // for previous if(!$pic_num) $previous="#nogo"; else {$temp=$pic_num-9; $previous="gallery.php?album_name=$album_name&pic_num=".$temp."&max=$max" ; } $query="SELECT pic_num,pic_name,pic_thumb,pic_full,pic_size,pic_desc FROM wizkid_mysite.gallery_$album_name where pic_num > '$pic_num'"; // echo"\n<br/>pic_num = $pic_num <br/>$query"; $query_result=mysql_query($query); echo"\n<div class=\"gallery\"><ul>"; if(!$query_result) { die("<br/>table ".mysql_error()); } $i=0; while(($row=mysql_fetch_row(($query_result)))&&($i++<9)) { echo"\n<li> \n \n<a href=\"$row[3]\"> \n<img src=\"$row[2]\" width=\"100px\" height=\"100px\" alt=\"$row[5]\"/> \n</a> \n</li> "; $for_next=$row[0]; } // if(!($row=mysql_fetch_row(($query_result)))&&$i++<9) while(($i)%3!=0) { $i++; echo"\n<li style=\"visibility:hidden;\"><a><img></a></li>"; } echo"\n</ul></div>"; // for next // echo"<br/>for_next= $for_next max=$max<br/>"; if($for_next<$max) $next=htmlentities($_SERVER['PHP_SELF'])."?album_name=$album_name&pic_num=$for_next&max=$max"; else $next="#nogo"; echo"\n<br/><p class=\"album_nav\"> \n<a href=\"".$previous."\">previous</a> \n<a href=\"".$next."\">next</a> \n<a href=\"".htmlentities($_SERVER['PHP_SELF'])."\">Change ALbum</a> \n</p>"; mysql_close($connection); }
There are lots of error like <a><img></a> You should see how to display the image Apart from that code you don't have the img tag to display full image