Re: Retrieving web pages

From: Date: Fri, 02 May 2003 23:00:11 +0000
Subject: Re: Retrieving web pages
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-146209@lists.php.net to get a copy of this message
The following or a tested facsimile of such should work: ob_start(); readfile( 'http://www.foo.com' ); $content = ob_get_contents(); ob_end_clean(); HTH, Rob. Mark Douglas wrote: > > Hi, > > I'm trying to figure out a way of retrieving the contents of web pages with > PHP. Currently I'm using the sockets example from php's site - > http://www.php.net/manual/en/ref.sockets.php - I've > modified the "one-shot > HTTP client" so that instead of just a head request it does a get. However, > with this method I get the headers as well as the page content. Help either > in stripping the headers, or using a different method to load page contents > would be greatly appreciated. Note that I don't want to just display the > contents, I want to be able to store it in a variable, or ultimately, a BLOB > column in a MySQL column. > > tia, > > Mark > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- .---------------------------------------------. | Worlds of Carnage - http://www.wocmud.org | :---------------------------------------------: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul. | `---------------------------------------------'

« previous php.general (#146209) next »