Reply to Re: Any ideas how to read a url that's changed by the server?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация