allow_url_fopen, remote URLs and cookies

From: Date: Mon, 04 Feb 2002 16:49:50 +0000
Subject: allow_url_fopen, remote URLs and cookies
Groups: php.general 
Request: Send a blank email to php-general+get-83426@lists.php.net to get a copy of this message
OK. I don't know if what I'm trying to do is going to work this way. I have three servers that I need to fetch data from. To do this, I have set allow_url_fopen to On, and I use fopen to retrieve the data into a variable. This works on two servers. The third server requires cookies (you get redirected to a login server if no cookie is sent, and I get a warning "URL - success" on the screen, followed by the if(!$file) test returning true) - and, even if the user has the cookie set - I don't see how to send it with an fopen call. I've tried using the virtual() function - that works (sends the cookie), but prints straight away - this is awkward because I'm halfway thru building up a larger html buffer. So - is it possible to send a cookie up with fopen, or, if not, how do I go about getting a remote file that requires one? Regards -- Chris Searle

« previous php.general (#83426) next »