Hi,
I'm trying to write a function that validates the input in a textarea. I
just want to allow alphanumrical characters, and if the user enters
anything else, I display an error message by calling error().
But the following doesn't work. Even if I enter "hello" in the textarea,
I get the error message. What am I missing?
// validate entered text in textarea
function validate_textarea($unchecked_text) {
if (!preg_match ("/^[a-zåäö0-9]$/is", $unchecked_text)) {
error("You have used unlegal characters, just alphanumeric is ok.");
}
}
Best regards,
Anders
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Re: [PHP] help with preg_match Anders Thoresson
- Re: [PHP] help with preg_match Tracy Finifter Rotton