Forum Moderators: coopster
if(empty($math) ¦¦ !is_numeric($math) ¦¦ $math < 0 ¦¦ $math > 20)
{
$error[] = "Le math field is invalid";
}
If I type 0 inside, it's issuing the above error message. How can I do so that Zero get accepted as an integer?
Thanks,
if(!isset($math) ¦¦ !is_numeric($math) ¦¦ $math < 0 ¦¦ $math > 20)
if(array_key_exists('submit', $_POST))
{
foreach(array_keys($_POST) as $key)
{
$$key=intval(trim($_POST[$key]));
switch($key)
{
case 'math':
if(empty($math) ¦¦ !is_numeric($math) ¦¦ $math < 0 ¦¦ $math > 20)
{
$error[] = "The math field is invalid";
}
break;
The code continues here....