php - HTML Radiobutton form not POSTing -


i have written small html form , added page. goal post value of checked button php page have written. php page not getting value reason. not getting php errors. codes below.


form.php

<form action="http://www.zbrowntechnology.com/insanebrain/quiz.php" method="post"> <font color="white" size="3"> <?php $con = mysql_connect("host", "user", "pass"); if(!$con) {   die('unable connect mysql:   '.mysql_error()); } mysql_select_db("zach_insaneb", $con); $result = mysql_query("select name quiz");  while($row = mysql_fetch_assoc($result)) {  $qname = $row['name'];  echo "<input type='radio' name='button1' id='$qname'>";  echo "<label for='$qname'><font color='white'/>$qname</font></label>"; } ?> </font> </div> </div>  <div id="oobj12"> <div id="gcode234" class="dfltc"> <input type="image" src="http://www.zbrowntechnology.com/insanebrain/begin.png" alt="begin" /> </form></div> </div> 

getdata.php

<?php $data = $_post['button1']; echo $data; ?> 

actually, see problem...you don't have value in radio button. need like:

echo "<input type='radio' name='button1' id='$qname' value='$some_value'>"; 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -