Posted by Andy Hassall on 08/20/07 18:01
On Mon, 20 Aug 2007 15:48:23 -0000, TechieGrl <cschaller@gmail.com> wrote:
>I apologize, but I posted this in the php general forum earlier and
>realized that this is the more appropriate forum. Hopefully there's a
>coder here who has done this in the past.
>
>I've got code that uses CURL to go a web page to read the data.
>
>When I type in www.website.com, the server automatically adds a
>session variable to the url. I need to be able to read that session
>variable. Then I will use that session variable to input into a new
>CURL session.
As in it redirects to something like http://example.com/?SESSIONID=blah
?
In which case, tell cURL to follow redirects:
http://uk.php.net/manual/en/function.curl-setopt.php
with option CURLOPT_FOLLOWLOCATION.
then read the "effective URL" from the handle with:
http://uk.php.net/manual/en/function.curl-getinfo.php
with option CURLINFO_EFFECTIVE_URL.
You should then be able to extract the session ID from that using your choice
of text matching function.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
[Back to original message]
|