Results 1 to 8 of 8
Threaded View
-
21st Jul 2011, 01:31 PM #6Respected MemberWebsite's:
DL4Everything.com Soft2050.inCheck this code:
PHP Code:<?php
function addnvalidateurls($url){
// Modified By: Soft2050
if (!preg_match("@^[hf]tt?ps?://@", $url)) {
$url = "http://" . $url;
}
$pattern = '/^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/';
return preg_match($pattern, $url);
}
$result = addnvalidateurls('http://www.google.com');
echo '<script language="javascript">';
if ($result == 1)
echo "alert('Yes! The given url is validated')";
else {
echo "alert('No! the given url seems to be not working')";
}
echo '</script>';
?>
If Url is not valid, then you can break the function to end it
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
VBSEO Urls
By viruz99 in forum Technical Help Desk SupportReplies: 0Last Post: 13th Nov 2011, 02:15 PM -
Issues with Recaptcha API urls
By NewEraCracker in forum Feedback and SuggestionsReplies: 1Last Post: 19th May 2011, 02:50 PM -
Re-write some URLs
By Chris2k in forum Web Application/Script SupportReplies: 4Last Post: 27th Mar 2011, 12:59 AM -
Blocked URLs
By Sun!l in forum Legal IssuesReplies: 2Last Post: 28th Feb 2010, 09:54 AM -
Legit DepositFiles Valid Accounts 1$ valid for 1 day
By piratebay in forum Completed TransactionsReplies: 2Last Post: 23rd Oct 2009, 01:56 PM
themaPoster - post to forums and...
Version 5.35 released. Open older version (or...