david-remone123 Posted May 6, 2009 Share Posted May 6, 2009 At the moment, my website is very basic and outputs the following on the page localhost/product-catalogue.php: echo "<font color=\"white\"><u>$productName</u></b><br><br>$productLine<br><br></font>"; echo "<img alt=\"product image\" width=\"250\" height=\"265\" src=\"images/".$image." \"/>"; echo "<font color=\"white\"></br><u>Product Description</u><br><br>$productDescription<br><br>£$sellPrice<hr color='gray' width='35%'></hr><br></font>"; I want to be able to click the image that is displayed, and then this will take you to localhost/product-catalogue.php?(productCode), so that I can add these products to a basket. Could someone please explain how I would do this, as i have tried and been unsuccessful. Thankyou. Quote Link to comment https://forums.phpfreaks.com/topic/157120-making-a-localhostpagephp-url-help/ Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 Wrap the image in an anchor tag. Quote Link to comment https://forums.phpfreaks.com/topic/157120-making-a-localhostpagephp-url-help/#findComment-827809 Share on other sites More sharing options...
david-remone123 Posted May 6, 2009 Author Share Posted May 6, 2009 Wrap the image in an anchor tag. Ahh i got it to work eventually. echo "<font color=\"white\"><u>$productName</u></b><br><br>$productLine<br><br></font>"; echo '<a href="product-catalogue.php?ProductID='.$productCode.'"><img src="images/'.$image.'" width="250" height="265" class="main_items_pic" alt="test image" /></a>'."\n"; echo "<font color=\"white\"></br><u>Product Description</u><br><br>$productDescription<br><br>£$sellPrice<hr color='gray' width='35%'></hr><br></font>"; Now when I click the image of say Product3 which has the productCode F00001, it takes me to product-catalogue.php?productCode=F00001, but this page looks exactly the same as the product-catalogue.php page. How do I edit the product-catalogue.php?productCode=F00001 page to only show that one item, rather than showing the whole catalogue? Please explain in the dumbest way possible lol Quote Link to comment https://forums.phpfreaks.com/topic/157120-making-a-localhostpagephp-url-help/#findComment-827830 Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 *Ken2k7 is thinking of the dumbest way possible... hmm ... OOH! Use PHP, there you go. I knew I would think of something. Quote Link to comment https://forums.phpfreaks.com/topic/157120-making-a-localhostpagephp-url-help/#findComment-827887 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.