Hi,
I have this function declaration (processing scripts left out):
function checkvar($var, $default, $type)
{
switch($type)
{
case 1: // integer code
break;
case 2: // text user input : prevent malicious code from running
break;
}
return $var;
}
Which I call:
$action = checkvar($_POST[action], 1, 1);
In the output I get this error message:
Warning: Missing argument 2 for checkvar() in ****/checkvar.php on line 3
Warning: Missing argument 3 for checkvar() in ****/checkvar.php on line 3
where line 3 is the function declaration line.
What am I doing wrong in this coding?
Thanks!
J.