Hello, I'm making a URL shorterner and if someone can make a function that can validate a URL and if its missing something it will add it. If you can make what I need then I will send $5, to your PayPal. Thanks
I don't want the money but: phpcentral.com/208-url-validation-in-php.html www.google.com/search?q=php+url+validation
I'm only offering money because I want some fancy code if a url is missing something (eg: 'http://', '/', ect...)the code will add it.
you can use this function to test if the link is ok function link_is_live($url){ $h = get_headers($url); $ok=false; if(preg_match('~HTTP/1\.\d\s+200\s+OK~', $h[0])) $ok=true; return $ok; } $url = 'http://wscripts.net/'; if(link_is_live($url)) echo 'yes'; else echo 'no'; //will return yes $url = 'http://wscripts.net/asdasd'; if(link_is_live($url)) echo 'yes'; else echo 'no'; //will return no PHP: