HTTP_Client: samples?
| From: | Robert | Date: | Fri, 04 Jun 2004 09:17:44 +0000 |
| Subject: | HTTP_Client: samples? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-12888@lists.php.net to get a copy of this message | ||
Hello,
someone can provide an example of how to correctly use the HTTP_Client class? I want to be able sending form data to a site and don't understand how to use the updateCookies function.
What I have so far and works:
require_once("../inc-php/head.php");
require_once 'HTTP/Client.php';
$data = array( "username" => $_SESSION["sUsername"], "password" => $_SESSION["sPw"], "redirect" => "", "login" => "Log In" );
$sUri = $aMyGlobals["sHttpHost"]."/phpBB/login.php";
$client =& new HTTP_Client();
$code = $client->post($sUri, $data);$response = $client->currentResponse(); echo $response['body']; Now I need to be able to store the cookies from login.php. Thanx in advance! Robert