cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

CURL, POST an Cookies???

From: Alexei Zoubov <tech_at_alexeiz.com>
Date: Fri, 21 Nov 2003 13:34:03 -0800

I'm trying to set cookies when posting to a page.

I got the script practically copied from PHP Cookbook with minor
alterations:

$post_arr = array (username =>'alexeiz' ,password =>'GOVNO32');
$c = curl_init('http://www.alexeiz.com/hit.php');
curl_setopt($c,CURLOPT_VERBOSE,1);
curl_setopt($c,CURLOPT_COOKIE,'user=MUDAK');
curl_setopt($c, CURLOPT_POSTFIELDS, $post_arr);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$page = curl_exec($c);
  curl_close($c);

  echo "<p> $page";

Postfiels are posted OK, but the cookie is never set - tried many times
in different enviroments.

What could be the problem? PHP is 4.3.2, cURL 7.10.3

Alexei

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
Received on 2003-11-21