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))
{
echo not valid;
}
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:
I am using the
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)
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 is not
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
[EMAIL
5 matches
Mail list logo