simple HTML form & PHP question

Discussion in 'Software' started by jpmad4it, Jan 25, 2006.

  1. jpmad4it

    jpmad4it Private E-2

    hello

    i have a HTML form (which the user completes) that submits the information in it to a PHP script which then compiles the information and enters it into a database. The problem is not all the data is being passed to the Database. i have noticed that the fields which have data missing from them is where the form is of the drop-down list type e.g. title -> mr, mrs, miss, Dr. can anyone tell me what i need to do to pass the drop-down list information to the PHP script and then to the database?

    any help will be great
    J
     
  2. Raits

    Raits Private E-2

    Didn't test it, but this should work.
    Code:
    <select name="title">
    <option value="a">a</option>
    <option value="b">b</option>
    </select>
    
    Here the value is stored in the variable $_POST['title'] and according to what the user chooses, the value should be eighter "a" or "b".
     
  3. jpmad4it

    jpmad4it Private E-2

    bingo - it worked.Thanks a million
     
  4. goldfish

    goldfish Lt. Sushi.DC

    I'm guessing that you didn't specify the value attributes?
     
  5. jpmad4it

    jpmad4it Private E-2

    yeah that correct
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds