oo7ml
06-26-2007, 02:59 PM
I have a combo box on my form for Gender
<select style="width: 180px" name="gender" tabindex="8">
<option selected="" value="null">--- Select Gender ---</option>
<option value="F">Female</option>
<option value="M">Male</option>
</select>
What sort of php validation do i need for this combo box.
I already have - if nothing is selected, it alerts the user.
Can you see if you can answer these three questions please:
1. Can someone alter my code and put in something other than what is in the combo box and submit it to my database.
2. Do i need to add mysql_real_escape_string to a combo box (i obviously do if someone can alter my code)
3. Do i need to add a max length validation to the combo box
Thanks for your help
<select style="width: 180px" name="gender" tabindex="8">
<option selected="" value="null">--- Select Gender ---</option>
<option value="F">Female</option>
<option value="M">Male</option>
</select>
What sort of php validation do i need for this combo box.
I already have - if nothing is selected, it alerts the user.
Can you see if you can answer these three questions please:
1. Can someone alter my code and put in something other than what is in the combo box and submit it to my database.
2. Do i need to add mysql_real_escape_string to a combo box (i obviously do if someone can alter my code)
3. Do i need to add a max length validation to the combo box
Thanks for your help