curl-and-php
RE : CURL, POST an Cookies???- AGAIN!!!
Date: Mon, 24 Nov 2003 10:24:51 +0100
Alexei,
Have you set up a directory where your server can write cookies ? If
not, that might be the problem. Try to chmod 0777 (or other) the
directory where you script executes...
Stephane
-----Message d'origine-----
De : curl-and-php-admin_at_lists.sourceforge.net
[mailto:curl-and-php-admin_at_lists.sourceforge.net] De la part de Alexei
Zoubov
Envoyé : lundi 24 novembre 2003 08:52
À : curl-and-php_at_lists.sourceforge.net
Objet : Re: CURL, POST an Cookies???- AGAIN!!!
Thanks, I checked the original script, the quotes ate OK there.
And my server doesn't understand Russian!
Alexei
On Sunday, November 23, 2003, at 08:13 PM, Felix Rabinovich wrote:
it may be too simple to be true, but - your cookie string
('username=alexeiz; password='GOVNO') has mismatched quotes. I would
expect a syntax error, but who knows... Other than that - maybe your
server rejects foul language :-)
Felix
----- Original Message -----
From: Alexei Zoubov
To: curl-and-php_at_lists.sourceforge.net
Sent: Sunday, November 23, 2003 4:24 PM
Subject: Re: CURL, POST an Cookies???- AGAIN!!!
I REALLY need help - does anybody has any idea?
$post_arr = array (username =>'alexeiz' ,password =>'GOVNO');
$c = curl_init('http://www.sampledomain.com/login.php');
curl_setopt($c,CURLOPT_VERBOSE,1);
curl_setopt($c, CURLOPT_POSTFIELDS, $post_arr);
curl_setopt($c,CURLOPT_COOKIE,'username=alexeiz; password='GOVNO');
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$page = curl_exec($c);
curl_close($c);
echo "<p> $page";
--------------------------------------------------------
This script does login correctly. But it also supposed to set cookies on
the client that triggers this script and it does NOT!
These cookies are needed so in the next CURL call the client can access
other pages at www.sampledomain.com that require these cookies to
authorize the client.
Is there anything wrong here, and if it is, how to achieve this goal?
On Sunday, November 23, 2003, at 07:26 AM, Daniel Stenberg wrote:
On Sat, 22 Nov 2003, Alexei Zoubov wrote:
Thank - how do I look at the outgoing header?
I don't know. With regular libcurl you use the CURLOPT_VERBOSE, but I
don't
think that works with PHP.
Use a network analyzer tool such as ethereal!
-- Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/ [[ Do not post private mails to this email address. They won't reach me. ]] ------------------------------------------------------- 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-24