i have written a code for the user to select his area of expertise with respect to fields. i am able to display selected checkboxes for those fields. But when i want tio process further like
when the user clicks on the particular checkbox and then submits i am not able to display the various options he/she has checked on.
the below is the initial html code
<html>
<head></head>
<body>
<h2>Please select your area of expertise </h2>
<p>
<form method="get" action="aoe.php">
<select name="area">
<option value="1">Computer science / Applications
<option value="2">Electronics
<option value="3">Mechanical
<option value="4">Biotechnology
</select>
<input type="submit" value="Send">
</form>
</body>
</html>
the below is the following php code
<html>
<head>
The choice whic u have selected is </head>
<body>
<?php
$day = $_GET['area'];
echo " Please select the related subjects ";
if($day == 1)
{
?>
<form name="form1" method="post" action="aoe.php">
<input type="checkbox" name="checkbox" value="checkbox">
Artificial Intelligence
<input type="checkbox" name="checkbox2" value="checkbox">
Operating Systems
<input type="checkbox" name="checkbox3" value="checkbox">
Compiler Design
<input type="submit" value="Send">
</form>
<?php
if (isset($_POST['checkbox']) )
{
?>
<p>" U have selected artificaial intelligence " </p>
<?php
}
}
elseif($day == 2)
{
?>
<form name="form2" method="post" action="aoe.php">
<input type="checkbox" name="checkbox" value="checkbox">
Microprocessor
<input type="checkbox" name="checkbox2" value="checkbox">
Electronic circuits
<input type="checkbox" name="checkbox3" value="checkbox">
Chip and dales
<input type="submit" value="Send">
</form>
<?php
}
elseif($day == 3)
{
?>
<form name="form3" method="post" action="aoe.php">
<input type="checkbox" name="checkbox" value="checkbox">
Machines
<input type="checkbox" name="checkbox2" value="checkbox">
Tools
<input type="checkbox" name="checkbox3" value="checkbox">
Aeromodelling
<input type="submit" value="Send">
</form>
<?php
}
else
{
?>
<form name="form4" method="post" action="aoe.php">
<input type="checkbox" name="checkbox" value="checkbox">
Genesis
<input type="checkbox" name="checkbox2" value="checkbox">
Cloning
<input type="checkbox" name="checkbox3" value="checkbox">
Aliens
<input type="submit" value="Send">
</form>
<?php
}
?>
</body>
</html>
The part where in i am getting err is beneath
<?php
if (isset($_POST['checkbox']) )
{
?>
<p>" U have selected artificaial intelligence " </p>
<?php
}
}