Hi. I'm wondering if someone might be able to give me a solution or suggestion for what I'm hoping to do. I have a product page with three products, each with an "Enquire Now" button that links to the contact page. On the contact page I'd like to have a dropdown list of each product - ie: your enquiry is regarding: 1, 2, 3. However, I'd like either 1, 2 or 3 to be pre-selected, dependant on which link they've clicked on the product page. Is it possible to send some extra info when they click? Thanks for your help.
Keeping it simple, you can have your enquiry link to /yourenquirypage.php?product=1 In yourenquirypage.php you then simply need to process the select box with the value in $_GET['product'] Example: You will want to tidy this code up and verify the contents you pass in, etc, but so you get the idea; <form action="f.php" method="post"> <select name="enquiry"> <option value="1" <?php if(isset($_GET['product']) && $_GET['product'] ==1) print "SELECTED";?>>1</option> <option value="2" <?php if(isset($_GET['product']) && $_GET['product'] ==2) print "SELECTED";?>>2</option> <option value="3" <?php if(isset($_GET['product']) && $_GET['product'] ==3) print "SELECTED";?>>3</option> </select> </form> Code (markup):
Great, that's exactly what I was after! I was sure that you could get it form appending ?="" but I wasn't sure how. Thanks!