User login

Checking if a web site URL is valid: There's a Drupal function for that

drupal php check valid url

A too-simple snippet contributed elsewhere:

<?php
function valid_url($str)
{
    return ( ! preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $str)) ? FALSE : TRUE;
}
?>

After following this epic thread
http://drupal.org/node/124492
it becomes clear that Drupal has a wonderful valid_url function of its own, thanks to mfer

http://api.drupal.org/api/function/valid_url/6