Woody777 Posted May 23, 2014 Share Posted May 23, 2014 Hi there to everyone I have a bit of an issue, I am still new to all this coding, I need help on to display my images in my uploads folder with some sort of image lightbox viewer: <?php require 'database.php'; $propertyid = null; if ( !empty($_GET['PropertyId'])) { $propertyid = $_REQUEST['PropertyId']; } if ( null==$propertyid ) { header("Location: sale.php"); } else { $pdo = Database::connect(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "SELECT * FROM properties where PropertyId = ?"; $q = $pdo->prepare($sql); $q->execute(array($propertyid)); $dataproperty = $q->fetch(PDO::FETCH_ASSOC); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql1 = "SELECT * FROM images WHERE PropertyId = ?"; $q1 = $pdo->prepare($sql1); $q1->execute(array($propertyid)); } echo '<li class="col-md-12">'; while ($row = $q1->fetch(PDO::FETCH_ASSOC) ) { Below is my images that need to be displayed in a lightbox way: echo ' <a href="'.$row['ImageUrl'].'"><img width="200px" src="'.$row['ImageUrl'].'"></a>'; } echo '<br />'; echo '<br />'; echo '<div class="proj_descr1"><h1>'. $dataproperty['Title'] . '</h1>'.'<br />'; echo '<div class="proj_descr_txt">'.'<h4><b>Location: </b></h4>'. $dataproperty['Location'] . '</div>'; echo '<br />'; echo '<div class="proj_descr_txt">'.'<h4><b>Bedrooms: </b></h4>'. $dataproperty['Bedrooms'] . '</div>'; echo '<br />'; echo '<div class="proj_descr_txt">'.'<h4><b>Bathrooms: </b></h4>'. $dataproperty['Bathrooms'] . '</div>'; echo '<br />'; echo '<div class="proj_descr_txt">'.'<h4><b>Parking: </b></h4>'. $dataproperty['Parking'] . '</div>'; echo '<br />'; echo '<div class="proj_descr_txt">'.'<h4><b>Property Type: </b></h4>'. $dataproperty['Type'] . '</div>'; echo '<br />'; echo '<div class="proj_descr_txt">'.'<h4><b>Status: </b></h4>'. $dataproperty['Status'] . '</div>'; echo '<br />'; echo '<div class="proj_descr_txt">'.'<h4><b>Description: </b></h4>'. $dataproperty['Description'] . '</div>'; echo '<br />'; echo '<div class="proj_descr_txt">'.'<h4><b>From: </b></h4>'. $dataproperty['FromThe'] . '</div>'; echo '<br />'; echo '<div class="proj_descr_txt">'.'<h4><b>Contact Details: </b></h4>'. $dataproperty['ContactDetails'] . '</div>'; echo '<br />'; echo '<div class="proj_descr_txt">'.'<h4><b>Price: </b>R</h4>'. $dataproperty['Price'] . '</div>'; echo '<A HREF="#" onClick="history.back();return false;">Go back</A>'; echo '</li>'; any help would be much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/288719-what-and-how-is-the-best-way-to-use-lightbox-for-my-images/ Share on other sites More sharing options...
ginerjm Posted May 23, 2014 Share Posted May 23, 2014 So - what have you tried??? Have you downloaded lightbox and read the docs and TRIED to use it??? Quote Link to comment https://forums.phpfreaks.com/topic/288719-what-and-how-is-the-best-way-to-use-lightbox-for-my-images/#findComment-1480639 Share on other sites More sharing options...
Woody777 Posted May 23, 2014 Author Share Posted May 23, 2014 Yes I have but its not working Quote Link to comment https://forums.phpfreaks.com/topic/288719-what-and-how-is-the-best-way-to-use-lightbox-for-my-images/#findComment-1480648 Share on other sites More sharing options...
ginerjm Posted May 23, 2014 Share Posted May 23, 2014 Well, you need to work on that. As for your code - kind of odd looking. All of your "images" code is in ONE list element tag? Quote Link to comment https://forums.phpfreaks.com/topic/288719-what-and-how-is-the-best-way-to-use-lightbox-for-my-images/#findComment-1480651 Share on other sites More sharing options...
Woody777 Posted May 23, 2014 Author Share Posted May 23, 2014 Yes Quote Link to comment https://forums.phpfreaks.com/topic/288719-what-and-how-is-the-best-way-to-use-lightbox-for-my-images/#findComment-1480660 Share on other sites More sharing options...
Woody777 Posted May 23, 2014 Author Share Posted May 23, 2014 Look I create a property with multiple images and it is linked with a property id so all my images for the properties is loaded in an uploads folder. Quote Link to comment https://forums.phpfreaks.com/topic/288719-what-and-how-is-the-best-way-to-use-lightbox-for-my-images/#findComment-1480661 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.