This is a discussion on Pretend to supply a cookie? within the PHP Language forums, part of the PHP Programming Forums category; Hi all, I am writing a web page which does the following: - performs HTTP requests to several specific pages - parses ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi all,
I am writing a web page which does the following: - performs HTTP requests to several specific pages - parses the results - displays customised versions of the data. I use fopen and it is really pretty straightforward, EXCEPT that one of the sites does not operate without cookies. So, although I can view the site using a browser, I cannot read it using fopen (well, actually I get the page that says I need to enable cookies, but I don't get the data I want.) Is there any way I can pretend that I have a cookie from PHP? -- Stephen Oakes |
|
|||
|
Stephen Oakes wrote:
> Is there any way I can pretend that I have a cookie from PHP? http://pear.php.net/package/HTTP_Client works fine for me. Matthias |
|
|||
|
"Stephen Oakes" <soakes1@XXXbigpond.net.au> wrote in message news:2C%Rc.43851$K53.24819@news-server.bigpond.net.au... > Hi all, > I am writing a web page which does the following: > - performs HTTP requests to several specific pages > - parses the results > - displays customised versions of the data. > > I use fopen and it is really pretty straightforward, EXCEPT that one of the > sites does not operate without cookies. So, although I can view the site > using a browser, I cannot read it using fopen (well, actually I get the page > that says I need to enable cookies, but I don't get the data I want.) > > Is there any way I can pretend that I have a cookie from PHP? > > -- > Stephen Oakes > Pass a stream context with a cookie to fopen(). See http://www.php.net/stream-context-create/. |