Hi!
I've got an unusual problem here. I'm trying to write a PHP script that
behaves like a web client. Why? I want to automatically check specific
URLs for changes.
I'm using file_get_contents(URL) to read the pages and this seems to
work just fine as long as there are no logins, sessions or cookies.
But I'm getting a new PHPSESSID from the site whenever I get a new page
(or refresh the same page) even though I did a login through the URL
(...login.php?user=...&pass=...) and it seemed to work. So the login
does not really work.
So what do I have to do to make the login stick? Use a different way to
read the pages? Work with sessions? Cookies?
Don't forget that the script is not running on a server, it is the
client! I have not found any documentation for this rare case.
I'm curious if any of the PHP pros out there knows an answer to this
problem. If anyone does, an answer would be appreciated. Thanks in
advance.