andrewweb1 Posted October 21, 2015 Share Posted October 21, 2015 Hi guys am having difficulties getting lightbox effect to work in php.The images don't get the lightbox effect here is my code <!DOCTYPE html> <html> <head> <script type="text/javascript" src="lightbox.js"></script> <link rel="stylesheet" href="css/lightbox.css"> </head> <body> <?php $page = $_SERVER['PHP_SELF']; //settings $column =5; //dir $base ="data"; $thumbs ="thumbnails"; // get album $get_album =$_GET['album']; if(!$get_album){ echo "<b>Select an Album:</b><p/>"; $handle = opendir($base); while(($file = readdir($handle)) !==FALSE) { if(is_dir($base."/".$file) && $file != "." && $file != ".." && $file != $thumbs) { echo "<a href='$page?album=$file'>$file</a><br>"; } } closedir($handle); } else{ // check security if(!is_dir($base."/". $get_album) || strstr($get_album,".")!=NULL || strstr($get_album,"/")!=NULL || strstr($get_album,"\\")!=NULL) { echo "Album doesn't exist."; } else{ $x=0; echo "<b>$get_album</b><p/>"; $handle =opendir($base."/".$get_album); while(($file =readdir($handle)) !== FALSE) { if($file !="." && $file !="..") { echo "<table style='display:inline-block;'><tr><td><a href='$base/$get_album/$file' rel='lightbox'><img src='$base/$thumbs/$file' height='100' width='100'></a></td></tr></table><br/>"; $x++; if($x==$column){ echo "<br/>"; $x=0; } } } closedir($handle); } echo "<p/><a href='album.php'>Back to albums</a>"; } ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted October 21, 2015 Share Posted October 21, 2015 The images don't get the lightbox effect yes, but what does happen? we are not sitting there with you and don't know what you saw. what did happen, even if nothing happened, and what did you expect to happened? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.