Closed Thread
Results 1 to 4 of 4

Thread: I need a help on PHP!!

  1. #1
    careerbridge's Avatar
    careerbridge is offline x10 Sophmore careerbridge is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    India
    Posts
    126

    Question I need a help on PHP!!

    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

  2. #2
    Corey's Avatar
    Corey is offline VPS Migration Professional Corey is a glorious beacon of lightCorey is a glorious beacon of light
    Join Date
    Dec 2004
    Location
    Northfield, NH
    Posts
    17,151

    Re: I need a help on PHP!!

    try
    <option value="0">Student</option>
    <option value="1">Employment</option>

  3. #3
    careerbridge's Avatar
    careerbridge is offline x10 Sophmore careerbridge is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    India
    Posts
    126

  4. #4
    Chris Z's Avatar
    Chris Z is offline x10 Spammer Chris Z is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Alabama, USA
    Posts
    2,802

    Re: I need a help on PHP!!

    looks like this is solved..
    [/CLOSED]
    -Chris Z
    Retired Account Manager


Closed Thread

Similar Threads

  1. Ever Been Suspended For Using PHP?
    By dragoneye_xp in forum Off Topic
    Replies: 26
    Last Post: 08-16-2009, 07:17 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. tons of PHP Resources
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-16-2009, 10:07 AM
  4. [PHP] PHP For Starters
    By Complex in forum Tutorials
    Replies: 24
    Last Post: 06-14-2008, 11:40 PM
  5. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers