[PHP] Re: numeric characters

2004-03-03 Thread Jakes
Another thing that you can do is cast the variable to integer

$int = (int) $_POST['data'];

Dominique Anokre [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Is there a way with php to force the user to put only numeric character in a
text field ?

thanks

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



[PHP] Re: numeric characters

2004-03-02 Thread Ben Ramsey
If you wanted to force them to put in valid numeric characters, you 
would have to use JavaScript (client-side).  However, if you wanted to 
verify the information from the server side, you could use is_numeric() 
to check whether the value is a number.

http://www.php.net/is-numeric

Dominique Anokre wrote:

Is there a way with php to force the user to put only numeric character in a text field ?

thanks

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php