dimanche 11 juin 2017

How to display the output of if-statement when click multiple value in checkbox?

When i select the Bathroom and Medium,the output display still the same as Room and Small. Help me please

Here is my code

<?php
if(isset($_POST['submit'])){
if(!empty($_POST['signs'])) {

// Counting number of checked checkboxes.
$checked_count = count($_POST['signs']);
echo "You have selected following ".$checked_count." option(s): <br/>";
// Loop to store and display values of individual checked checkbox.

foreach($_POST['signs'] as $selected) {

echo "<p>".$selected ."</p>";
{
 if( $selected = "Room" && $selected = "Small")
{
    echo "Result : Your best color for your room is light color";
}

else if ( $selected = "Bathroom" && $selected = "Medium")
 { echo "Your color is medium light color"; }
}
}

Aucun commentaire:

Enregistrer un commentaire