My first page is checkbox form
<!DOCTYPE html>
<html>
<body>
<form action="1.php" method="POST">
<input type="checkbox" name="count" value="count">count<br>
<input type="checkbox" name="search" value="search">search<br>
<input type="checkbox" name="order" value="order">order
<input type="submit" value ="submit">
</form>
</body>
</html>
Then my next page is collecting the values using post and by using if conditions displaying the result
<?php
if(empty($_POST['count'])) {
$_POST['count']='';
}
else {
$a=$_POST['count'];
}
if(empty($_POST['order'])) {
$_POST['order']='';
}
else {
$b=$_POST['order'];
}
if(empty($_POST['search'])) {
$_POST['search']='';
}
else {
$c=$_POST['search'];
}
if($_POST['count']=="count" && $_POST['search']=="search" && $_POST['order']=="order" ) {
echo "I have a count ,search and order" ;
}
else if($_POST['order']=="order" && $_POST['count']=="count" && $_POST['search']!="search" ) {
echo "I have a order and count";
}
else if($_POST['search']=="search" && $_POST['count']=="count" && $_POST['order']!="order" ) {
echo "I have a search and count";
}
else if($_POST['search']=="search" && $_POST['order']=="order" && $_POST['count']!="count" ) {
echo "I have a search and order";
}
else if($_POST['count']=="count" || $_POST['search']=="search" || $_POST['order']=="order" ) {
echo $_POST['count'];
echo $_POST['search'];
echo $_POST['order'];
}
?>
I have a bike condition is working
I have a car condition is working
I have a car and bike is not working , I am new to this language so plz help