Re: Anybody knows LWC::UserAgent (Perl) equivalent for PHP ?

From: Date: Tue, 03 Dec 2002 23:10:24 +0000
Subject: Re: Anybody knows LWC::UserAgent (Perl) equivalent for PHP ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-126909@lists.php.net to get a copy of this message
Haha, working on this same problem myself, right now. I used curl.
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_URL, $base . $page . '?' . $query);
       curl_setopt($ch, CURLOPT_HEADER, 0);
       curl_setopt($ch, CURLOPT_COOKIE, $_SESSION['session']);
       curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
       $buffer = curl_exec($ch);
       curl_close($ch);
It's pulling in data from the $_SESSION for the cookie, but read up and you can see how to put in your own cookies. Some more info at php.net/curl it's not very friendly there though, but once you get the idea you'll go far. Some examples(not many, I might add) over at: http://curl.haxx.se/libcurl/php/examples/ Hope this helps. As far as without curl, can't really help you there. Others can I'm sure. Vincnetas Vienozinskis wrote:
message the same as the subject :) i need something for PHP to work with site that requires cookies. And i hate to handle HTTP header and all those Coocies by my self :) --Joseph Guhlin
http://www.bahwi.cc/ Web Developer / Unix Consultant

« previous php.general (#126909) next »