Hello everyone..
There is a problem with this PHP code...
PHP developers find it out..
<?php $badinput=false; function check($arg1,$arg2) { if(($arg1<0)||($arg1>100)) { $badinput=true; } if(strlen($arg2)>32) { $badinput=true; } } $val=499; $name="
Unexpected results or non-execution "; check($val,$name); if(!$badinput) echo "Good"; else echo "Bad input"; ?>
waiting for solution...
Please leave a reply..
Regards : M2 Software solutions Pvt. Ltd.
This comment has been removed by the author.
ReplyDeleteThe problem was in your "CHECK" function and "IF" at the end of file.
Deletefunction check($arg1,$arg2)
{
if(($arg1<0)||($arg1>100) && strlen($arg2)>32)
{
return TRUE;
} else {
return FALSE;
}
}
$val=101;
$name="Unexpected results or non-execution ";
$badinput = check($val,$name);
echo ($badinput === TRUE ? 'GOOD': 'BAD INPUT!');
yes thats the error... thanks for replying...
Delete