1). Turning the URL to lowercase is a bad idea, as *nix servers are case-sensitive.
2) You are assuming the user entered the server name as well as the simple link.
If you really wanna check a url, you gonna need lot more checking that!
function cleanURL($url) {
$url = trim($url);
if (eregi("http*://", $url)) {
return $url;
} elseif (eregi("[\w]+.[\w]+.[\w]+", $url)) {
//Might wanna check my regular expression
return "http://$url";
} else {
//No server specified, do whatever ya want
}
}