The checkbox is not working properly. It has 3 checkbox. when i select all three checkbox i don't get any error. but when i select 1 or 2 checkbox i am getting error like this :
Notice: Undefined index: chke in C:\wamp\www\test\secpage.php on line 16
<html>
<body>
<table>
<form method="post" action="secpage.php">
<tr>
<td colspan="2"><center><h4>Registartion Form</h4></center></td>
</tr>
<tr>
<td>Username : </td>
<td><input type="text" name="txtname" value=""/></td>
</tr>
<tr>
<td>Password : </td>
<td><input type="password" name="txtpass" vale=""/></td>
</tr>
<tr>
<td>Email : </td>
<td><input typ="text" name="txtemail" value=""/></td>
</tr>
<tr>
<td>Address : </td>
<td><textarea name="add" /></textarea></td>
</tr>
<tr>
<td>Subjects : </td>
<td><input type="checkbox" name="chkm" value="Maths"</td>Maths
<td><input type="checkbox" name="chks" value="Science"</td>Science
<td><input type="checkbox" name="chke" value="English"</td>English
</tr>
<tr>
<td>Gender : </td>
<td><input type="radio" name="gen" value="Male"/>Male
<input type="radio" name="gen" value="Female"/>Female
</td>
</tr>
<tr>
<td colspan="2"><center><input type="submit" value="Submit"/></center></td>
</tr>
</body>
</html>
This is php page :
<html>
<body>
<?php
$uname=$_POST["txtname"];
$pass=$_POST["txtpass"];
$email=$_POST["txtemail"];
$add=$_POST["add"];
$subm=$_POST["chkm"];
$subs=$_POST["chks"];
$sube=$_POST["chke"];
$gen=$_POST["gen"];
?>
<table>
<tr>
<td>Username : </td>
<td><?php echo $uname; ?></td>
</tr>
<tr>
<td>Password : </td>
<td><?php echo $pass; ?></td>
</tr>
<tr>
<td>Email : </td>
<td><?php echo $email; ?></td>
</tr>
<tr>
<td>Address : </td>
<td><?php echo $add; ?></td>
</tr>
<tr>
<td>Subject Selected : </td>
<td><?php echo $subm." ".$subs." ".$sube; ?></td>
</tr>
<tr>
<td>Gender : </td>
<td><?php echo $gen ?></td>
</tr>
</table>
</body>
</html>
Any help will be appreciated.