Php to find largest of three number

  
(Largest.html)

<html>
<head>
<style>
h1{color:white;}
</style>
</head>
<body bgcolor="orange">
<form method="POST" action="large.php">
<h1>Number 1:<input type="number" name="n1"><br>
<h1>Number 2:<input type="number" name="n2"><br>
<h1>Number 3:<input type="number" name="n3"><br>
<input type="submit" value="submit">
<br>
</form>
</body>
</html>

o\p


Embed PHP script in form tag
(large.php)

<html>
<body bgcolor="orange">
</html>
<?php
$a=$_POST["n1"];
$b=$_POST["n2"];
$c=$_POST["n3"];
if($a>$b&&$a>$c)
echo "<h1>$a is the largest";
else
if($b>$c&&$b>$a)
echo "<h1>$b is the largest";
else
if($c>$a&&$c>$b)
echo "<h1>$c is the largest";
else
echo "<h1>all are equal";
?>




Comments