Hi all,
I am stuck!
I have a page which when you select an item from a list box, the page posts a productid to itself and the page redraws and list the details linked to that productid which come from a database. This is simple enough and is working great, however, when the page is first displayed, I also have thumbnail images of these products and I want to be able to click an image and allow the page to re-draw itself like it does with the list box.
My problem it, it is not working!!! Could someone please take a moment to look at my code and maybe point my issue out?
<?php
$productselected = false;
$rangeid= $_GET['rangeid'];
$productid = $_GET['productid'];
// Get the posted variables from the form ($_POST['selecteditem'] is my list box!!)
if ($_POST['selecteditem']) {
$productselected = true;
$productid = $_POST['productid'];
$rangeid= $_POST['rangeid'];
}
?>
//I would then have my HTML code here
Now comes my code and images..
$sqlquery = "SELECT productid, image FROM tblproducts WHERE rangeid = $rangeid";
$dataresult = mysql_query($sqlquery);
while ($datarow = mysql_fetch_array($dataresult)) {
$productid = $datarow['productid'];
$image = $datarow['image'];
echo " <div id=\"smallimgbox\">
<a href=\"productdetails.php?productid=$productid&rid=$rangeid\"><img src=\"$imageref\" /></a>
</div>";
The page posts but does not redraw itself displaying all of the product details like it does when i post my list box.
Please suggest..?
Thanks in advance