curl-and-php
Re: PHP cURL & session cookie
Date: Mon, 15 Oct 2001 12:43:17 +0200 (METDST)
> > $ch=curl_init('test.php/switch/form')
> > curl_setopt( CURL_TIMEOUT, 120 );
> > curl_setopt( CURL_RETURNTRANSFER, 0 );
>
> ^ These two lines are not correct, they must pass the curl handle as a
first
> argument, like the other curl_setopt() calls below...
OK, I'm sorry. My code have the curl handle
> Well to start with, in your command line version you certainly did not
call
> the postfields 'form_xml' as you did up here.
OK, at this point I make mistake too. Second call in my command line
version should be:
curl -m 120 -b PHPID=<session_id_from_Header.txt> -d form_xml=<...>
http://my.server.com/test.php/switch/form > Page.html
> How come you had to do two command line operations but only should us
one
> written in PHP? It was obviously not matching any of the command line
> versions either.
First command line operations is a logging procedure. Second - send the
xml_form to test.php.
In my code user is already logged in
> Can't you just, slowly, try to make the command line versions into PHP
step
> by step?
>
> Then if that doesn't work, show us the command lines again and the PHP
code
> you've written to "simulate" those command lines.
>
I don't understand :((. Make the command line version into PHP via
exec("") function? Or cURL function? How can I make this step by step?
Summary - I would show difference between command line -b option and PHP
curl_setopt( $ch, CURL_COOKIE, session_name.'='.session_id() ). Command
line version works fast, PHP - very slow :(.
Today news :)
When I use curl_setopt( $ch, CURL_COOKIE,
session_name.'=1111111111111111111111' ) instead curl_setopt( $ch,
CURL_COOKIE, session_name.'='.session_id() ) - PHP version works as fast
as command line version. I don't know why :(
P.S. Sorry for my English and mistakes
Krzysztof Araszkiewicz
Received on 2001-10-15