Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   image links not working (http://www.go4expert.com/forums/image-links-t11799/)

boygenius 3Jul2008 00:17

image links not working
 
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.

shabbir 3Jul2008 09:00

Re: image links not working
 
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

boygenius 3Jul2008 12:52

Re: image links not working
 
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

shabbir 3Jul2008 12:57

Re: image links not working
 
There is definitely some problem in your code and if you share that we may be able to help

boygenius 3Jul2008 17:43

Re: image links not working
 
here's the portion of the code(gallery.php) that generates the images and links

PHP Code:

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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n<a href=\"".$next."\">next</a>             
            \n<a href=\""
.htmlentities($_SERVER['PHP_SELF'])."\">Change ALbum</a>
            \n</p>"
;
            
mysql_close($connection);
             



shabbir 3Jul2008 20:25

Re: image links not working
 
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


All times are GMT +5.5. The time now is 17:01.