You are here: Re: Any ideas how to read a url that's changed by the server? « PHP Programming Language « IT news, forums, messages
Re: Any ideas how to read a url that's changed by the server?

Posted by Rik on 08/20/07 21:12

On Mon, 20 Aug 2007 22:57:01 +0200, TechieGrl <cschaller@gmail.com> wrot=
e:

>
>> You should then be able to extract the session ID from that using yo=
ur =

>> choice
>> of text matching function.
>>
>
>
> Now that I've extracted the unique key from the url, I'm finding that
> I'm having problems opening up the actual pages. This unique key
> appears to be their session variable and so now their server views the=

> first hit to the server as sesson 1 and assigns it an id. Then when I=

> send in a new url with the session id, it views it as being a new
> session and so that unique session id is no longer valid.
>
> Any thoughts?

Probably you need to use cookies.

<http://nl3.php.net/manual/en/function.curl-setopt.php>

//create sort of 'anonymous' cookiefile in temporary directory
$cookiefile =3D tempnam();

//initiliaze curl
$c =3D curl_init();

//follow redirects
curl_setopt($c,CURLOPT_FOLLOWLOCATION,true);

//store & retrieve cookies
curl_setopt($c,CURLOPT_COOKIEFILE,$cookiefile);
curl_setopt($c,CURLOPT_COOKIEJAR,$cookiefile);

//some people still think referrer should be checked, hidious:
curl_setopt($c,CURLOPT_AUTOREFERER,true);

//set the url
curl_setopt($c, CURLOPT_URL, "http://www.example.com/");

//and go:
curl_exec($c);

//and close
curl_close($c);

//and delete cookiefile
unlink($cookiefile);

-- =

Rik Wasmus

 

Navigation:

[Reply to this 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

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