RE: [PHP] fsockopen

From: Date: Tue, 26 Mar 2002 12:36:48 +0000
Subject: RE: [PHP] fsockopen
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-90171@lists.php.net to get a copy of this message
Is $tempPort set ? Alastair Battrick Senior Developer Lightwood Consultancy Ltd http://www.lightwood.net > -----Original Message----- > From: Christoph Starkmann [mailto:kiko@nfq.de] > Sent: 26 March 2002 12:40 > To: 'php-general@lists.php.net' > Subject: [PHP] fsockopen > > > Hi! > > I'm trying to check the validity of given hyperlinks... > I thought this code should work (Apache 1.3.9, Win98) > > $tempUrl = ereg_replace("http://", "", > $url); > > $fp = fsockopen ($tempUrl, $tempPort, &$errno, &$errstr, 30); > > if (!$fp) > { > echo "<br>error opening $url: \$errstr=$errstr, > \$errno=$errno<br>\n"; > } > else > { > fputs ($fp, "GET / HTTP/1.0\r\n\r\n"); > echo "<br>s>>>" . fgets($fp,1024); > fclose($fp); > } > > For each and every url, > > $fp = false; > $errstr = ""; > $errno = 0; > > Where is my mistake? I guess I'm simply getting sth wrong... > > Any hint would be great. > > Cheers, > Kiko > > ----- > It's not a bug, it's a feature. > christoph starkmann > mailto:kiko@nfq.de > http://www.fh-augsburg.de/~kiko > ICQ: 100601600 > ----- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#90171) next »