1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Rep Power
    ...when a form has a question where the response can be one or more selections either from a series of chech box inputs or a selection list, how would i set into variables only the responses that are checked or selected so that only these values are available for exporting to a mySQL database?
    ...help with this will be much appreciated.
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Rep Power

    you can check whether the variable is set or not with isset()function..

    if (isset($checkbox)){
    #set the value for the varibale here..

    SR -
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Perth West Australia
    Rep Power
    if you mean you have something like ..

    option1<input type=radio name=thisfield value=1>
    option2<input type=radio name=thisfield value=2>

    then form variable $thisfield = 1 or 2 depending on selection, then in a conformation form you would use....

    option1<input type=radio name=thisfield value=1 <?php if($thisfield==1){ echo "checked";}?>>

    option2<input type=radio name=thisfield value=2 <?php if($thisfield==2){ echo "checked";}?>>

    AM I even close to what you meant?

    Simon Wheeler
    FirePages -DHTML/PHP/MySQL

Similar Threads

  1. Replies: 3
    Last Post: February 4th, 2004, 12:04 PM
  2. HTTP Error 400: Bad Request, with basic form
    By crackwombat in forum PHP Development
    Replies: 1
    Last Post: January 23rd, 2004, 06:40 PM
  3. Replies: 8
    Last Post: January 20th, 2004, 08:04 PM
  4. HTML form problem - variables not returning please HELP!
    By sienna in forum HTML Programming
    Replies: 0
    Last Post: January 11th, 2004, 02:37 PM
  5. Replies: 0
    Last Post: January 8th, 2004, 07:55 PM

IMN logo majestic logo threadwatch logo seochat tools logo