Jump to content

ctype_alnum


sofia403

Recommended Posts

I'm trying to make it so that the username in registration form is only alphanumeric. i have that code below, but it still passes through all the special characters. is there a mistake im making someplace? thanks

 

if( empty($_POST['name'])){
header("Location:Messages.php?msg=3"); 
exit();
}
elseif (ctype_alnum($_POST['name'])) {
header( "Location:Messages.php?msg=26" ); 
exit();
}

Link to comment
https://forums.phpfreaks.com/topic/238339-ctype_alnum/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.