<form name="form1" method="post" action="page2.php">
<input type="checkbox" value="w" name="check1" checked="true" />Women
<input type="checkbox" value="m" name="check1" />Men
<input type="submit" value="Sumit choice" />
</form>
In page2.php
// Check if the variable exist.
if(isset($_POST['check1']))
{
// obtain the value of the checkbox.
$check1 = $_POST['check1'];
}
else
{
$check1 = -1
}
// check the value in the variable "$check1"
// if the user check the option for Men
if($check1 == "m")
{
$request = "SELECT * FROM USER WHERE sex=".$check1;
mysql_query($request) or die((mysql_error();)
}
else
{
// show all the women members.
$request = "SELECT * FROM USER WHERE sex=".$check1;
mysql_query($request) or die((mysql_error();)
}
I how this will help you 😃