×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Maniruzzaman Akash
Added: Aug 19, 2016 8:59 PM
Views: 17
Validate name for the input
  1. /**
  2. Validate name for the input...
  3. **/
  4. $name = test_input($_POST["name"]);
  5. if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
  6.   $nameErr = "Only letters and white space allowed";
  7. }