curl-and-php
Re: Save CURL sessions
Date: Tue, 12 Oct 2004 12:29:15 +0000
Once curl executes in a script, the script would return to the caller (web
server) and serve the output produced by the script. If you are talking about
passing information in HIDDEN HTML tags, then yes you can do that. But
resusing a curl connection like Tommaso wants is not possible.
On Tuesday 12 October 2004 03:41 pm, Harry Fearnley wrote:
> Brian Wilkins wrote:
> > Best way to solve this is through session cookies. The script will end
> > before curl will be allowed to "stay alive".
>
> I have tried my "solution" below with some success. Each time I click
> the "submit" button, the page is refreshed (with potentially very
> different information), and information is simply passed onwards
> from one state to the next ...
>
> Have I misunderstood your comment?
>
> Harry
>
> > On Tuesday 12 October 2004 03:33 pm, Harry Fearnley wrote:
> >>Tommaso Trani wrote:
> >>> I would like to handle a curl connection between multiple executions
> >>> of my php script.
> >>>For example I make a login to a private area (with curl) and then I wont
> >>>make some action in this area.
> >>>I would like to make just one time the login, than save the curl session
> >>>informations in a cookie, file or php session. So I can get this info
> >>>between multiple executions of my php script avoiding to make again the
> >>>login.
> >>>
> >>>Is it possible? I've tried to store the resource returned by curl_init
> >>>in a sessions, but, of course, this way doesn't work because it's a
> >>>resource and not a structured variable (I've tried using serialize, but
> >>>it's a resource and doesn't work).
> >>
> >>If I have understood you correctly ...
> >>
> >>Can you make the action of the HTML form to call itself again,
> >>and simply pass the information as HIDDEN values in a form?
> >>Something like this:
> >>
> >>
> >><FORM ENCTYPE="multipart/form-data" ACTION="this_file.html"
> >> METHOD="post"> <INPUT TYPE="hidden" NAME="hidden1" VALUE="10485760">
> >>
> >>
> >>Harry
> >>
> >>+-+-+-+-+.+-+-+-+-+.+-+-+-+-+.+-+-+-+-+.+-+-+-+-+.+-+-+-+-+.+-+-+-+-+.+-+
> >>-+ -+-+- http://www.eng.ox.ac.uk/people/Harry.Fearnley
> >>Dept Engineering Science, Parks Rd, Oxford, OX1 3PJ, UK
> >>Tel: +44 (0)1865 273928 -- Fax: +44 (0)1865 273010
-- -- Heritage Communications Corporation Melbourne, FL USA 32935 http://www.hcc.netReceived on 2004-10-12