Form validation and accents characters
-
Hello.
Maybe anybody know where I am wrong.
I have a form with just 1 text filed.
This form send ajax post request to php script.
When I send : ABC
In the server side (PHP) script I can do this
<?php
if(preg_match("/ABC/",$_POST['text'])) {
echo "FOUND";
} else {
echo "NOT FOUND";
}
?>OK.
Now ! If I put in my form text field a symbol like & or some special or accent character the preg_match doesn’t recognize it !
Before I thinked is won’t woks with a accents char. But after I simple put & simbol and has same result like with a accents char.
Where I am wrong ?
For example try to send via form ajax post request with data like :
hello & world and via preg_match check if it has & symbol..
I tried different thing but all no has success..
You must be logged in to reply to this topic.