for ($i=1;$i<=3;$i++)
{
echo $_POST["grass_$i"]; // Pollen name echo $_POST["gamt_$i"]; // Pollen amount
if (is_int($_POST["gamt_$i"]))
{
continue;
}
else
{
die("Non-numeric data entered in grass entry field(s).");
}
}
The two echo statements accurately return what data is in the two input fields. The program dies when there is integer data returned in the echo $POST["gamt_$i"] statement.
If I negate the expression in the if statement like so : if (!is_int($_POST["gamt_$i"]))
the program runs. Isn't that a bit weird?
It gets weirder. If I enter an alpha character with if (!is_int($_POST["gamt_$i"])), the program still runs but treats the alpha character as a 0.
How should I construct that if statement so that the program will only run with integer data or no data entered into the input fields?
TIA
Bob Harvey
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php