RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 800 | Replies: 1 | Thread Tools  Display Modes
Reply
Join Date: Dec 2007
Posts: 24
Reputation: chitra1 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
chitra1 chitra1 is offline Offline
Newbie Poster

sending radio button to database

  #1  
May 16th, 2008
Hi, I hav created html pages containing radio buttons and checkboxes. But how do I send the values of radio buttons and checkboxes and drop down button values to my database using POST.

here are my radio buttons and drop down button:

  1. <tr> <td>Marital Status</td> <td>:</td>
  2. <td>Single</td>
  3. <td><input type="radio" name="mar" value="" checked></td>
  4. <td>Married</td>
  5. <td><input type="radio" name="mar" value=""></td>
  6. <td width="12%">Divorcee</td>
  7. <td width="30%"><input type="radio" name="mar" value=""></td>
  8. </tr>


  1. <td width="18%">Date of birth</td>
  2. <td width="4%">:</td>
  3. <td width="14%"><select name="date" size="1">
Last edited by peter_budo : May 17th, 2008 at 6:52 am. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Location: Oklahoma
Posts: 169
Reputation: ProfessorPC is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 17
ProfessorPC ProfessorPC is offline Offline
Junior Poster

Re: sending radio button to database

  #2  
May 17th, 2008
i have done this with radio buttons im sure the same will work with the drop downs
in the form add your radio button
<input type="radio" value="Vista" name="os"><label>Vista</label>
then when you have your form send the info to the php script you can call it like this
$os = $_POST['os'];
$add = mysql_query("INSERT into Operating_Systems (os) Values (`$os`)") or die(mysql_error());
this will get the value of the selected radio button and insert into the db.
Last edited by ProfessorPC : May 17th, 2008 at 12:13 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the PHP Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 11:14 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC