I'm using ctype_alpha
to check if name is entered correctly. This is the code:
Get $ime
:
$ime = mysql_real_escape_string($_POST["ime"]);
Check $ime
:
if (!ctype_alpha(str_replace(array(
"'",
"-",
), "", $ime))) {
header("Location: error.php?error=14");
break;
}
I'm from Croatia, and we have characters like: "č", "ć", "š", ...
So i tried to add setlocale function:
setlocale(LC_ALL, 'hr_HR','hrv_HRV', 'hr', 'hrv', 'croatian', 'hrvatski', 'Croatian', 'Hrvatski', 'hr_HR.utf8');
But still after using characters "č", "ć", "š"
it throws me an error (redirect to error.php?error=14
)
Is there any other way to solve this, because I really need to be able to use those characters?