Re: fopen problem, 5 line script

From: Date: Wed, 15 Sep 2004 16:52:45 +0000
Subject: Re: fopen problem, 5 line script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-196754@lists.php.net to get a copy of this message
--- Mag <genphp@yahoo.com> wrote: > Hi, > Can someone tell me what I am doing wrong here please? > > <?php > $fileptr = > > fopen("http://www.google.com/index.html","r"); > > $contents = fread($fileptr, filesize($fileptr)); http://us2.php.net/filesize int filesize ( string filename) > > if(strstr($contents, > "href=\"/froogle?hl=en&tab=wf\"")) > { $result = 1;}else{ $result = 2;} > > echo $result; > ?> > > This is the error I get: > Warning: filesize(): Stat failed for Resource id #1 > (errno=2 - No such file or directory) in > /home/quickxxx/public_html/tpg/ check- remote.php on > line 4 > > Warning: fread(): Length parameter must be greater > than 0. in / > home/quickxxx/public_html/tpg/check-remote.php on line > 4 > 2 > > > > Any ideas? > > Thanks, > Mag > > ===== > ------ > - The faulty interface lies between the chair and the keyboard. > - Creativity is great, but plagiarism is faster! > - Smile, everyone loves a moron. :-) > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers! > http://promotions.yahoo.com/new_mail > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > ===== Mark Weinstock mark_weinstock@yahoo.com *************************************** You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing. *************************************** __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail

« previous php.general (#196754) next »