Re: How to include a page not on my host

From: Date: Fri, 30 Jun 2000 16:42:16 +0000
Subject: Re: How to include a page not on my host
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-4057@lists.php.net to get a copy of this message
oops! (there is another close-paren after the "r") php@theorb.net wrote: > > Hi Peter, > > How about: > > <? > $file = "http://www.some.domain/file.nam"; > $size = 100000; > > if (!$fp = fopen($file, "r") die("Could not open $file for read"); > $page = fread($fp, $size); > fclose($fp); > > echo $page; > ?> > > where $size is some arbitrarily large number. fread will read until EOF > or $size, whichever comes first. > > good luck, > mike wright > > Peter Benoit wrote: > > > > That was even easier than what I came up with, but it returns a number at > > the end, which I guess from the docs is the number of bytes read. Is there > > a way to keep this number from appearing? > > > > -----Original Message----- > > From: TomHenry [mailto:tomhenry@direct-connection.com] > > Sent: Friday, June 30, 2000 12:05 PM > > To: Peter Benoit > > Cc: php-general@lists.php.net > > Subject: RE: [PHP] How to include a page not on my host > > > > Try > > > > readfile("http://whateverdomain/filename.html"); > > > > HTH > > Tom Henry > > > > At 11:48 AM 6/30/00 -0400, Peter Benoit wrote: > > >When I try include or require I get: > > > > > >Failed opening required > > >'http://www.xxxxxxxx.com/xxxx.html > > (include_path='') > > > > > > > > > > > >and when I try to use fopen I get: > > > > > >The file exists!Resource id #1 > > > > > -- > 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 -- Before dot there was dot dot.

« previous php.general (#4057) next »