curl-and-php
Re: Maintining a session
Date: Thu, 8 May 2008 18:18:43 +0530
Hi there
The thing you are lookinh for will be done using HTTP REQUEST and HTTP
RESPONSE packages in php.
Since using curl you have to make cookies.jar go along, even if you are
redirecting to navigate through the apllication.
If you are interested i HTTP REQUEST/ RESPONCE and if you find problem in
understanding i can help you over that.
Thanks and Regards
Peeyush Gulati
2008/5/7 Lee French <lee.french_at_isev.co.uk>:
> Dear Group,
>
>
>
> I am in the process of writing a php script that adds items to a shopping
> cart on another website and then performs a header redirect to the cart page
> on the other website. However, at the moment my curl session is not
> maintained on the redirect session (which I expected to be honest). Is it
> possible for me to maintain the session used during the curl interactivity?
> This is an example of the code I am using :
>
>
>
> $ch = curl_init();
>
> curl_setopt($ch, CURLOPT_URL, "
> http://www.cartwebsite.co.uk/index.php?action=showbasket&_prodid=
> ".$_POST['panel_select']."&_qty=".$_POST['panelqty']);
>
> curl_setopt($ch, CURLOPT_HEADER, 0);
>
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>
> curl_setopt($ch,CURLOPT_FOLLOWLOCATION,0);
>
> curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/mycookie");
>
> curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/mycookie");
>
> curl_exec($ch);
>
> curl_close($ch);
>
>
>
> header('location: http://www.cartwebsite.co.uk/index.php?action=showbasket
> ');
>
>
>
> If I set RETURNTRANSFER to be 0 the session is maintained of course and
> content echoes however I wish to allow users to continue on the redirect
> website with their cart items intact. I hope this makes sense and any help
> you can give me would be great. Many thanks.
>
>
>
> Kind Regards,
>
>
>
> *Lee French *// *iSev Limited *//* * website design - website
> applications - website hosting
>
> *T. *08700 347 913 //* M.* 07946 586 598 //* E.* *lee.french_at_isev.co.uk*//
> * W.* *www.isev.co.uk*
>
>
>
> Would you like to see our work? *www.isev.co.uk/web-design*
>
> * *
>
> iSev Limited, e-Innovation Centre SE119, Shifnal Road, Priorslee, Telford,
> TF2 9FT
>
>
>
>
>
>
> ------------------------------------------------------------------------------------------
>
> This email and its attachments may be confidential and are intended solely
> for the use of the individual to whom it is addressed. Any views or opinions
> expressed are solely those of the author and do not necessarily represent
> those of "iSev Limited".
>
>
>
> If you are not the intended recipient of this email and its attachments,
> you must take no action based upon them, nor must you copy or show them to
> anyone. Although we operate anti-virus programmes, we cannot guarantee that
> this email and any files transmitted with it are virus free and we cannot
> accept liability for any damage sustained as a result of the software
> viruses.
>
>
>
> Please contact the sender if you believe you have received this email in
> error. For more information on iSev Limited, visit our website at:
> http://www.isev.co.uk <http://www.220i.co.uk/>
>
>
>
> Registered in England and Wales - Company Number: 6553217. Registered
> Offices: iSev Limited, e-Innovation Centre SE119, Shifnal Road, Priorslee,
> Telford, TF2 9FT
>
>
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>
-- Thanks and Regards Peeyush Gulati +91-9916304135
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-05-08