JasonDFR
10-29-2008, 08:44 AM
if ( preg_match("/^[ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûçÇA-Za-z0-9]{2,40}$/", $_POST['theme_name']) ) {
$theme_name = $_POST['theme_name'];
} else { // Theme name NOT ok
$errors[] = '<p class="error">Blah Blah</p>';
}
The above code works, I think.... But I would like to allow these characters as well "? - ' : ! ."
I can't seem to get anything to work or perhaps I am not testing it correctly.
The apostrophe is giving me trouble in particular. And it seems that the apostrophe is escaped automaticly when POSTed by the form. For example
echo $_POST['theme_name']; will output "cat\'s" when "cat's" is entered in the input field.
Thanks a lot!
J
$theme_name = $_POST['theme_name'];
} else { // Theme name NOT ok
$errors[] = '<p class="error">Blah Blah</p>';
}
The above code works, I think.... But I would like to allow these characters as well "? - ' : ! ."
I can't seem to get anything to work or perhaps I am not testing it correctly.
The apostrophe is giving me trouble in particular. And it seems that the apostrophe is escaped automaticly when POSTed by the form. For example
echo $_POST['theme_name']; will output "cat\'s" when "cat's" is entered in the input field.
Thanks a lot!
J