hello everyone ! ,
I am creating a form with various check boxes in it. The check boxes represent various type of workshop the person wants to attend.
i just dont know how to process the data in check boxes.
check.html
The html code is :
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>Please select the check boxes to for registering for the workshop</p>
<form name="form1" method="post" action="check.php">
<input type="checkbox" name="cr" value="checkbox">
Clinical REsearch
</form>
<form name="form2" method="post" action="check.php">
<input type="checkbox" name="bt" value="checkbox">
Biotechnology
</form>
<form name="form3" method="post" action="check.php">
<input type="checkbox" name="mc" value="checkbox">
Medical stuff
</form>
<form name="form4" method="post" action="check.php">
<input type="checkbox" name="none" value="checkbox">
None of them , i was kidding...... heheheheh
</form>
<form name="form5" method="post" action="check.php">
<input type="submit" name="Submit" value="Register me now">
</form>
<p> </p>
</body>
</html>
the check.php code is :
<?php
$dbc = mysqli_connect('localhost','root','','aliendb')
or die('error connecting to MySql');
$fin = 'hey';
if( (isset($_POST['cr'])) && (isset($_POST['bt'])) && (isset($_POST['mc'])) )
{
$fin = "clinical research" . '</br>' . "Biotech" . '</br>' . "Medical crap";
}
echo 'ur registered no go home ';
$query = "INSERT INTO checkbox(workshop)".
"VALUES ('$fin')";
$result = mysqli_query($dbc , $query) or die('Error querying db');
mysqli_close($dbc);
?>
wat i want is when the person clicks on one or more of the boxes , in my database the corresponding data must be entered in workshop coloumn.
example:
if the person clicks on
1.Medical Biotechnolgy
2.CLinical REsearch
Then in the workshop coloumn , these two names must be entered by the query.
I would really appreciate if u guys can help me out.