Hi All,
Need help in order to complete the following:
Through the file form.htm the users are asked to insert their weight and height which will
be submitted to the result.php file using the post method. If the value for the weight
($wt) is between (70 - 85 Kg) AND that for the height ($ht) is between (170-180 cm) the
result.php file will print the following comment($comment) "Your weight is within normal
limits" and open the web page of an external website ($externalURL).
But if the value of $wt is between (95-110 Kg) AND that of $ht is between (160-170 cm)
another comment is printed "You are over weight" and the web page of another external
website is opened.
My question is:
What is the BEST way to make the result.php file give the previously described results through
dividing the screen into 2 sections an upper 20% section showing in it the $comment
variable, and a lower 80% section which should display the web page of the external url
represented by the $externalURL variable.
the code for the form file :
<html>
<head>
<title>Insert your weight and height</title>
</head>
<body>
<form action="result.php" method="post">
Your weight: <input type="text" name="weight" />
Your height: <input type="text" name="height" />
<input type="submit" />
<p> </p>
</form>
</body>
</html>
the code for file result.php :
<html>
<head>
<title>Result</title>
</head>
<body>
<?php
$wt=$POST["weight"];
$ht=$POST["height"];
?>
<?php
if (($wt>=70 && $wt<85) & ($ht>=170 && $ht<180))
{
$comment="Your weight is within normal limits";
$externalURL="http://www.yahoo.com";}
if ( ($wt>=95 && $wt<110) & ($ht>=160 && $ht<170))
{
$comment="You are over weight";
$externalURL="http://www.google.com";}
?>
</body>