Get Form Data
1 | $_GET["field"] |
Validation
Not empty
1 | if (empty($_POST["field"])) { |
Letters and white space only
1 | if (!preg_match("/^[a-zA-Z ]*$/",$field)) { |
E-mail address
1 | if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { |
Url
1 | if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$url)) { |