lundi 3 septembre 2018

Issue comparing values in php

I have this php code meant to compare two values,a variable $rate received from a form which can either have values 'applaud' or 'boo' so I want to check if the value is neither of it and kill the page with an error message.I've tried that but ...localhost can not handle this request

HERE IS MY CODE:

<?php 
$rate=$_POST['rate'];
echo $rate;

?>

<?php

if($rate != 'applaud' OR $rate != 'boo')
{

die("Sorry there was a problem var rate was not well stated");
}

else
{
    echo 'yay ,well stated!!!';
}
?>

Aucun commentaire:

Enregistrer un commentaire