Accept five cities and temperature and display graphically |PHP Program|

<html>
<body>
<h2>Enter five cities and their temperature</h2><br>
<form action="" method="post">
City1<input type="text" name="city1"/>
Temp1<input type="text" name="temp1"/><br><br>
City2<input type="text" name="city2"/>
Temp2<input type="text" name="temp2"/><br><br>
City3<input type="text" name="city3"/>
Temp3<input type="text" name="temp3"/><br><br>
City4<input type="text" name="city4"/>
Temp4<input type="text" name="temp4"/><br><br>
City5<input type="text" name="city5"/>
Temp5<input type="text" name="temp5"/><br><br>
<input type="submit" value="submit">
</form>
</body>
</html>

<?php
if($_POST){
$city1=$_POST["city1"];
$temp1=$_POST["temp1"];
$city2=$_POST["city2"];
$temp2=$_POST["temp2"];
$city3=$_POST["city3"];
$temp3=$_POST["temp3"];
$city4=$_POST["city4"];
$temp4=$_POST["temp4"];
$city5=$_POST["city5"];
$temp5=$_POST["temp5"];
echo "$city1&nbsp&nbsp";
echo "<meter min=0 low=40 high=90 max=100 value=$temp1></meter>";
echo "$temp1<br>";
echo "$city2";
echo "<meter min=0 low=40 high=90 max=100 value=$temp2></meter>";
echo "$temp2<br>";
echo "$city3";
echo "<meter min=0 low=40 high=90 max=100 value=$temp3></meter>";
echo "$temp3<br>";
echo "$city4";
echo "<meter min=0 low=40 high=90 max=100 value=$temp4></meter>";
echo "$temp4<br>";
echo "$city5";
echo "<meter min=0 low=40 high=90 max=100 value=$temp5></meter>";
echo "$temp5<br>";
}
?>

OUTPUT



Post a Comment

0 Comments