Form validation using php regular expression
PHP form validation is important because if any one inactivate javaScript, then can pass garbage value. So we need to check it for filtering. Simple example: <?php if($_POST){ $name = $_POST['name']; $email = $_POST['email']; $username = $_POST['username']; $password = $_POST['password']; $gender = $_POST['gender']; // Full Name if (eregi(‘^[A-Za-z0-9 ]{3,20}$’,$name)){ $valid_name=$name; }else{ $error_name=’Enter valid Name.’; [...]
