White_Lily Posted September 25, 2012 Share Posted September 25, 2012 Hi i have a slight problem, in my if and else statement that checks whether or not there is an image in the database when there is an image, there is a href tag that wraps around image the image so that once the image is clicked it then does a lightbox effect. the problem im having is that when there IS an image, the href tag is NOT wrapping around the image. <?php if(!$res["image"]){ echo 'No Image'; }else{ echo '<a href="'.$res["image"].'" rel="lightbox">'.displayImage($res["image"], $res["name"], NULL, 150, 150).'</a>'; } ?> Link to comment https://forums.phpfreaks.com/topic/268778-href-not-wrapping-around-image-function/ Share on other sites More sharing options...
Jessica Posted September 25, 2012 Share Posted September 25, 2012 Post DisplayImage. It needs to return a string, not echo. Link to comment https://forums.phpfreaks.com/topic/268778-href-not-wrapping-around-image-function/#findComment-1380786 Share on other sites More sharing options...
White_Lily Posted September 25, 2012 Author Share Posted September 25, 2012 Okay thank you, is there a "solved" button on this new design? O.o Link to comment https://forums.phpfreaks.com/topic/268778-href-not-wrapping-around-image-function/#findComment-1380792 Share on other sites More sharing options...
DavidAM Posted September 25, 2012 Share Posted September 25, 2012 Okay thank you, is there a "solved" button on this new design? O.o It is at the very top of the topic. Link to comment https://forums.phpfreaks.com/topic/268778-href-not-wrapping-around-image-function/#findComment-1380812 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.