single.phps

<html><body>

<?php

if($_POST['submit'] && $_POST['myage'] && $_POST['difference']){
   
$total= $_POST['myage'] + $_POST['difference'];

echo
"My brother/sister is ".$total." years old.";

}else{

?>


<form method=post action="<? echo $PHP_SELF; ?>" >

How old are you? <input type=text name=myage value="" size=3>
<br>
How many years older is your brother/sister?
<br>
<SELECT name="difference">
<option VALUE="0">0
<option VALUE="1">1
<option VALUE="2">2
<option VALUE="3">3
<option VALUE="4">4
<option VALUE="5">5
</SELECT>

<p>
<input type="submit" name="submit" value="submit">
</form>

<?
}
?>
</body></html>

      Subscribe in a reader