I am facing a problem with the following error if I unselecked the checkbox..
Notice: Undefined index: choice in C:\xampp\htdocs\test.php on line 15
Notice: Undefined index: choice in C:\xampp\htdocs\test.php on line 18 Bye Bye indranil
here is my code
<html>
<head>
<form action="test.php" method="post">
<input type="checkbox" name="choice" value="indranil" />Indranil<br />
<input type="submit" name="submit" value="submit" />
</form>
<?php
if(isset($_POST['submit']))
{
if ($_POST['choice']=="indranil")
{
echo "Hello indranil";
}
if ($_POST['choice']!="indranil")
{
echo "Bye Bye indranil";
}
}
?>
</body>
</html>
Please help me with a proper explanation and proper code because I am a begginer in php. Thank You.