I have to confess, this is more of an HTML issue than a PHP issue, but I can't find the answer to this question anywhere. I hope someone can help...
I'm finishing off a PHP script that takes info from a simple HTML form and puts that info into a MySQL database.
Now, if the user screws up the form somehow (e.g., by leaving a box blank) then the form is redisplayed and a message comes up saying something like "Hey man, you forgot to fill out the name box!".
Anyway, I've got it going so that when the form does reappear, then the values that the guy got right first time round are still on the form (to save the user the time and frustration of having to re-type everything).
Here's the problem-
I know how to display all of the previous submissions for text fields. It's just a case of doing this code:
<input type=text name='event' size=30 value='$_POST[email]'>
BUT, the trouble is I don't know how to get that to happen when we're dealing with a drop down menu. My code for the drop down is as follows:
<select name='salewant'>
<option value='select'>PLEASE SELECT</option>
<option value='For Sale'>For Sale</option>
<option value='Wanted'>Wanted</option>
</select>
So, my question is... does anyone know how to modify the above piece code so that instead of displaying "Please Select" it actually displays whatever the guy selected last time he did the form (that's a variable called "$_POST[salewant]")?
I'm hoping to eventually put this thing on the page http://www.topgig.com/tickets.htm and I won't be making any money from it.
I hope someone out there can help.