Re: [PHP] Checking url validation

2002-03-29 Thread Billy S Halsey
Oops ... That's not balanced. Add another ) at the end of the if. /bsh/ Billy S Halsey wrote: > Try an extra layer of parens: > > if (($fp = fopen("http://www.anyurl.com";, "r") == NULL) > { > echo "not valid"; > } > else > { > echo "this is a valid url"; > } > > > Roberts, Mark wrote

Re: [PHP] Checking url validation

2002-03-29 Thread Billy S Halsey
Try an extra layer of parens: if (($fp = fopen("http://www.anyurl.com";, "r") == NULL) { echo "not valid"; } else { echo "this is a valid url"; } Roberts, Mark wrote: > I am using the following to verify a url: > > if (!$fp = fopen("http://www.anyurl.com";, "r")) > { > ec

Re: [PHP] checking url

2001-04-25 Thread Subodh Gupta
Hi Dmitry, In case you want a regular expression to check if it is a valid url you can try this... $url = "yoururl"; if(empty($url) && !eregi("^http://[A-Za-z0-9\%\?\_\:\~\/\.-]+$,$url)) $errmsg="$url doesn't look like a valid URL\n"; I hope this helps. Subodh Gupta I have learned, Joy i

RE: [PHP] checking url

2001-04-25 Thread Maxim Maletsky
well, you can try fsockopen. see it on php.net/fsockopen it will even return you an error if not connected. start from the example describing the function on PHP.net/fsockopen (did I misspelled it?) Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [E

Re: [PHP] checking url

2001-04-24 Thread Plutarck
How do you mean, "check"? Do you want to use a regular expression to see if it's a valid URL, or do you want to open a connection to it and see if the site actually exists? -- Plutarck Should be working on something... ...but forgot what it was. "Dmitry" <[EMAIL PROTECTED]> wrote in message [E