Basically, you shouldn't be checking for '1' as an answer.
Either you got 0, and it didn't work, or you didn't, and the URL is valid.
--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Kenneth R Zink II" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Thursday, March 22, 2001 3:47 PM
Subject: [PHP] Fopen help
I'm trying to use Fopen to check and see if a URL exist with this bit of
code.
$url=$row[url];
echo "<strong>Old URL = ".$url."</strong><br>";
$urlcheck = fopen($url,"r");
echo "urlcheck = ".$urlcheck."<br>";
switch ($url){
case "":
case "http://":
echo "<strong>No URL Set</strong><br>";
break;
default:
switch ($urlcheck){
case 1:
echo "<strong>Valid URL</strong><br>";
break;
case 0:
echo "<strong>URL Is Not Valid</strong><br>";
$url="http://";
break;
default:
echo "<strong>Fopen Did Not Work</strong><br>";
}
break;
}
echo "<strong>New URL = ".$url."</strong><br>";
So far all I can get it to do is the default response. Can someone point
out what I'm doing wrong or tell me how to see what the contents of a
resource id is please?
Old URL = http://www.s-series.org/htm/firestorm/firestorm.htm
urlcheck = Resource id #4
Fopen Did Not Work
New URL = http://www.s-series.org/htm/firestorm/firestorm.htm
Kenneth R Zink II [EMAIL PROTECTED] ICQ# 5095094
'87 2.8L TBI GMC S-15 Ext. Cab (Hurricane) ...524 in the works !!!
http://www.s-series.org/htm/windstorm/project-windstorm.htm
'85 3.4L Carbed Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI DIS !!!
http://www.s-series.org/htm/firestorm/firestorm.htm
'84 5.0L (307 "Y") Carbed Oldsmobile Delta 88 Royal Brougham. Daily driver
until FireStorm is ready.
Racing by the Grace of God!!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]