Jump to content

Recommended Posts

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. 
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.