i wrote this code.
in this code we user guess a number then program checked the number with the number that i gite to it and print appropriates message.
when i start program it shows welcome that is true but when i entered number in it always it shows little in output but it isn’t true.
$val = '42';
$gues ;
if(!isset($gues))
$mess = "welcome<br>";
elseif($gues > $val)
$mess = "bigr<br>";
elseif($gues < $val)
$mess = "little<br>";
else
$mess = "win<br>";
$gues = @(int) $gues;
?>
<html>
<head><title>bazi riazi</title></head>
<body>
<h1>
<?php print $mess;
?>
</h1>
<form method="POST">
type you gues here:<input type="text" name='gues'>
</form>
</body>
</html>
How your var
$guesget value from form? Did you use$_POST['gues']first?Script always print
littlebecause probably variable$gueswas not initialized any value (default is zero, I suppose…).