Search
 
SCRIPT & CODE EXAMPLE
 

PHP

PHP Forms - Validate E-mail and URL

$email = test_input($_POST["email"]);
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
  $emailErr = "Invalid email format";
}

$website = test_input($_POST["website"]);
if (!preg_match("/(?:(?:https?|ftp)://|www.)[-a-z0-9+&@#/%?=~_|!:,.;]*[-a-z0-9+&@#/%=~_|]/i",$website)) {
  $websiteErr = "Invalid URL";
}
Comment

PREVIOUS NEXT
Code Example
Php :: get basename without extension Laravel 
Php :: header file same but page title are different in php 
Php :: fix-wordpress-limit-permalink 
Php :: PHP Number Shortener 
Php :: php file structure 
Php :: load player avatar url 
Php :: How to add watermark in FPDF PHP - Parte 1 
Php :: logout php mysql 
Php :: convert array to associative array php 
Php :: php session set error 
Php :: php get from second character of string to middle 
Php :: symfony postgresql 
Php :: functions file erased wordpress 
Php :: Code début HTML 
Php :: Assignment By Reference 
Php :: objeto php em sessão 
Php :: standalone laravel orm 
Php :: PHP strnatcmp — String comparisons using a "natural order" algorithm 
Php :: run url in php 
Php :: laravel attribute event 
Php :: Command "make:auth" is not defined. 
Php :: remove public from laravel 
Php :: join in php 
Php :: php iterate through objects 
Php :: at C:UsersKamyarweb-pages elebotvendorsymfonyprocessPipesWindowsPipes.php:63 laravel error 
Php :: SendEmailVerificationNotification::class 
Php :: use htaccess to redirect in cpanel lsrsvel 
Php :: php ajax registration form validation 
Php :: laravel DomPDF live preview 
Php :: php exponential equation 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =