Thanks mushroom.
I found onlamp.com, which had a great example on what you suggest.
I have put my first version at
http://womens-health-and-fitness.com...mass-index.php
Problems so far:
1. It seems to reset the input values to blanks when it redisplays the screen.
2. When you try to refresh the screen, you get the message 'cannot refresh, retry or cancel'. Is that normal with forms calling the same page?
3. I couldnt test this offline. I have e-novative's WAMP environment on my PC to test PHP, and this exact code would NOT process the isset command offline. I had echos coming out of my seat trying to see why it wouldn't go into my if statement. After 2 hours I uploaded it and it worked. Is this normal for offline PHP environments?
I put the php code immediately above the form, as follows:
<?
$bminum = "";
$bmitext = "";
if (isset($metric_bmi_entered)) {
$height = $_POST["bheight"];
$weight = $_POST["bweight"];
$squareheight = $height * $height;
$bmi = $weight / $squareheight;
$bminum = sprintf ("%1.2f", "$bmi");
if ($bminum < 18.5) {
$bmitext = "underweight"; }
elseif ($bminum < 25) {
$bmitext = "normal" ; }
elseif ($bmitext < 30) {
$bmitext = "overweight"; }
else { $bmitext = "obese";}
}
?>
I spent time looking at the php switch command, but couldn't see how to put a range of values, or >< in the case statement. Definite beginner.
ta Chris