Re: Reading Remote Files
| From: | developer | Date: | Wed, 06 Dec 2000 08:05:13 +0000 |
| Subject: | Re: Reading Remote Files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28856@lists.php.net to get a copy of this message | ||
Tom -
not sure if this is the problem or not, but might be worth looking at - both
of your die("couldn't read"); statements contain un-escaped single quotes.
try this die("couldn\'t read");
jon
----- Original Message -----
From: Tom Harris <stry_cat@yahoo.com>
To: <php-general@lists.php.net>
Sent: Tuesday, December 05, 2000 11:18 AM
Subject: [PHP] Reading Remote Files
Hi folks,
I'm having trouble working with a remote file. What I want to do is grab an
HTML file from our partner's site, and remove a chunk of between two html
comments <!--Start border1--> & <!--End border1--> and then display what's
left of the file in the browser.
The first problem is when I do fread it dies in the following code
$filename="http://www.remoteserver.com/thefile.html";
$fp=fopen($filename, "r") or die("couldn't open");
$body=fread($fp, filesize($filename)) or die("couldn't read");
I'm guessing it can't get the filesize from a remote system, is there a way
around this?
Of course after this problem is solved, I have to figure out how to cut out
the chunk of text.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net