Forum Moderators: coopster
i have a form that submits to a php file, the form basically has a hidden field called number:
<input type="hidden" name="number" value="12">
i know how to read the value of that, its simply putting <?php echo $_POST['number']?> but what i want to do is check if the number is between 1 and 25 and if it is then echo A else if it is between 25-75 then echo B else if it is anything above 75 then echo C
can anyone please help me on this.
many thanx in advance
$number = (isset($_POST['number']))? $_POST['number'] : 0;
switch ($number) {
case ($number <= 25):
echo 'A';
break;
case ($number <= 50):
echo 'B';
break;
default:
echo 'C';
break;
}