Transfering html Form Option values to mysql INSERT function

Posted on 2009-02-19
Medium Priority
Last Modified: 2013-12-12
I'm trying to pass values from an html option value to php variable then to
This may be a simple task but at the moment can not see where I'm going wrong.  The other variables are inserted OK just id is not.
Question by:richmatt
LVL 16

Expert Comment

ID: 23681005
please post your code for analysis
LVL 12

Accepted Solution

Richard Davis earned 250 total points
ID: 23681679
Try this test form...perhaps this will answer your question for you.

Hope this helped. :)

		print "<pre>";
		print "</pre>";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<form name="test" method="post" action="<?=$_SERVER['PHP_SELF']?>">
<input type="radio" name="myOpts[]" value="1" /> Option 1<br />
<input type="radio" name="myOpts[]" value="2" /> Option 2<br />
<input type="radio" name="myOpts[]" value="3" /> Option 3<br />
<select name="selOpts[]">
 <option value="sel1">Select 1</option>
 <option value="sel2">Select 2</option>
 <option value="sel3">Select 3</option>
</select><br />
<input type="submit" name="submit" value="Submit" />

Open in new window


Author Closing Comment

ID: 31548718
The solution was obtained from the sample test form ie where name = should go and what name that should be.

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question