M.W.S. Posted February 9, 2007 Share Posted February 9, 2007 <?php echo "Hello World" ?> How to restrict characters on registration of in textfields? Thanks! Link to comment https://forums.phpfreaks.com/topic/37799-restrict-characters-on-registration/ Share on other sites More sharing options...
sspoke Posted February 9, 2007 Share Posted February 9, 2007 regular expressions I use this foreach($_POST as $field => $value) { if (ereg("(Name)",$field)) { if (!ereg("^[A-Za-z' -]{1,50}$",$value)) { unset ($_GET['do']); $message_new = "$field is not a valid name, please check and try again."; header("Location:index.php?page=register"); exit(); } } $$field = strip_tags(trim($value)); } Link to comment https://forums.phpfreaks.com/topic/37799-restrict-characters-on-registration/#findComment-180838 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.