php Guidelines
php-Guidelines
Home
PHP Introduction
Contact
Privacy Policy
Sunday, 1 February 2015
Url Validation
we can also validate our url by use following regular expression:
<?php
$weburl= test_input($_POST["url"]);
if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$weburl)) {
$weburlErr= "Invalid URL";
}
?>
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment