I need a help on PHP!!

Status
Not open for further replies.

careerbridge

New Member
Messages
252
Reaction score
0
Points
0
Hi,


I nee a help on PHP


I am building a web form which POSTs the data to a php file. It contains a menu item like the one bellow,


Code:
 <select name="select1">
<option selected="selected">Student</option>
<option>Employment</option>
<option>Business</option>
<option>Profession</option>
<option>Workers</option>
</select>
In the php file I can get the user selection as the text, ie if user selected the first option


$_POST['select1'] gives me the value "Student"....

Here is the problem, I don't want the TEXT, I need the list index. ie If the user selects the option Student I need its index ie 0

Any idea how to get it ?? please help



Regards,
Jim Jose
 

Corey

I Break Things
Staff member
Messages
34,553
Reaction score
204
Points
63
try
<option value="0">Student</option>
<option value="1">Employment</option>
 
Status
Not open for further replies.
Top