Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
PHP - Validate URL
SUBMITTED BY:
Guest
DATE:
Oct. 7, 2014, 12:33 p.m.
FORMAT:
Text only
SIZE:
213 Bytes
Raw
Download
Tweet
HITS:
1089
Go to comments
Report
$website = test_input($_POST["website"]);
if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) {
$websiteErr = "Invalid URL";
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus