Glese Posted December 2, 2011 Share Posted December 2, 2011 I do want to validate a password input field to only allow numbers and letters without special character and spaces, and I also do want the same for the name input field. Since the old fashioned ways are deprecated. How would one approach to solve this issue the new way? Link to comment https://forums.phpfreaks.com/topic/252301-text-string-validation/ Share on other sites More sharing options...
canabatz Posted December 2, 2011 Share Posted December 2, 2011 function safe($value){ return mysql_real_escape_string($value); } if($_POST['submit']) { $username1=safe($_POST['username']); $password=safe($_POST['password']); .......more code here Link to comment https://forums.phpfreaks.com/topic/252301-text-string-validation/#findComment-1293417 Share on other sites More sharing options...
QuickOldCar Posted December 2, 2011 Share Posted December 2, 2011 http://php.net/manual/en/function.ctype-alnum.php Link to comment https://forums.phpfreaks.com/topic/252301-text-string-validation/#findComment-1293422 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.