My coding for form is (addform.php):
<form name="add" method="post" action="addprocess.php" id="signup" onSubmit="return checkform(this);">
<table width="452" border="1" align="right" cellpadding="4" cellspacing="3" bordercolor="#003093" id="table">
<tr>
<td class="labelfield">Payment:</td>
<td nowrap class="labelfield">
<input type="radio" name="types" value="1" checked>
Paid
<input type="radio" name="types" value="2">
None
</td>
</tr>
</table>
<input name="submit_rec" type="submit" class="button" id="submit_rec" value="Add New Record" >
<input type="submit" name="reset" value="Reset" class="button">
</form>
For (addprocess.php) is:
include "connection.inc";
if(isset($_POST['submit'])) {
$types = $_POST['types'];
$sql = "INSERT INTO records VALUES('$types')";
$results = mysql_query($sql);
if (!$results) {
echo "Unable to store data";
}
}
mysql_close();
?>
I did this already, BUT still it didn't work. The radiobutton value didn't insert into database.
Anyone help me please...