Practical 11 : Write a PHP program for check given number is positive or negative or zero
<html>
<head>
<title>Practical : 11</title>
</head>
<body>
<?php
$no='';
if(isset($_POST['ok']))
{
$no = $_POST['t1'];
if($no<0)
{
echo "<b>" .$no. " is Negative</b>";
}
else if($no>0)
{
echo "<b>" .$no. " is Positive</b>";
}
else
{
echo "<b>" .$no. " is Zero</b>";
}
}
?>
<center>
<form name="f1" method="post">
<table>
<tr>
<td>
<input type="text" name="t1" value="<?php echo $no; ?>">
<input type="submit" name="ok" value="Click Me">
</td>
</tr>
</table>
</form>
</center>
</body>
</html>

EmoticonEmoticon