Re: [PHP] How do I validate input using php?

2002-07-24 Thread JSheble

you're returning a literal true if the condition matches, and nothing if it 
fails...

function validate() { //
 if ( is_numeric($input1) && is_numeric($input2) && 
ctype_alpha($input3) &&
 ctype_alpha($input4) )
 return true;
 else
 return false;
}

At 12:38 AM 7/25/2002 +0200, Øystein Håland wrote:
>I've tried a function like this:
>function validate() { //
>if ( is_numeric($input1) && is_numeric($input2) && ctype_alpha($input3) &&
>ctype_alpha($input4) )
>  return true;
>}
>
>
>And then I call the function:
>
>if (validate() == false) {
> some action;
>}
>
>My problem is I get the action every time, even though the input is of the
>right type. And, is ctype_alpha() the only way to check for only alphabetic
>characters?
>And (this started with one question), anyone got a good solution on
>validating email-adresses with php?
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] How do I validate input using php?

2002-07-24 Thread Øystein Håland

I've tried a function like this:
function validate() { //
if ( is_numeric($input1) && is_numeric($input2) && ctype_alpha($input3) &&
ctype_alpha($input4) )
 return true;
}


And then I call the function:

if (validate() == false) {
some action;
}

My problem is I get the action every time, even though the input is of the
right type. And, is ctype_alpha() the only way to check for only alphabetic
characters?
And (this started with one question), anyone got a good solution on
validating email-adresses with php?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php