I have this code:
<label for=subject accesskey=S>Subject</label>
<select name="subject" type="text" id="subject">
<option value="a dog">Dog</option>
<option value="a cat">Car</option>
<option value="a tree">Tree</option>
</select>
If I wanted to preselect a selection via the URL,
Would it not be:
http://xxx.com/contactus.php?subject=a cat
I have tried the above and it does not work.
I have had a look around and there are posts about adding Java Script. I wish to avoid that if possible.
If you url is
http://xxx.com/contactus.php?subject=a catYou can use
$_GET['subject']to get to the value of subject.So something like:
Dont forget to use urlencode on your values and strip them before using in a query. Like so:
http://xxx.com/contactus.php?subject=a%20catandurlencode(stripslashes($_GET['subject']))