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";
> }
> else
> {
> echo "this is a valid url";
> }
>
> I always get a not valid message. What am I doing wrong? Is there a better
> way to do this?
>
> Mark Roberts
> Sr. Systems Analyst
> LanApps/Web Development
> The Williams Information Services Corporation
> 918-573-1706
> [EMAIL PROTECTED]
>
>
>
--
/---------------------------------------------=[ BILLY S HALSEY ]=--\
| Member of Technical Staff, Sun Microsystems, Inc. ESP Solaris SW |
| "All opinions and technical advice offered in this message are my |
| own and not necessarily endorsed by my employer." |
\--=[ [EMAIL PROTECTED] ]=--------------------------------------------/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php