0

Is it possible to log in on another site from localhost or for example my server where a website runs on?

Here's what I want to do: Every hour a cronjob should get the website data via file_get_contents() and check for new private messages. If there is an unread one, open it, extract the contents and do some other stuff with it. The problem: Everytime I try to get the contents, it'll just go to the login site.

Thanks in advance.

What
  • 157
  • 1
  • 1
  • 8
  • You might find this other question helpful: http://stackoverflow.com/questions/1797510/file-get-contents-receive-cookies – Femi Mar 20 '14 at 14:05

1 Answers1

1

Your script need to login into the target website, you can use curl for do that. http://php.net/manual/fr/book.curl.php/

openghost
  • 62
  • 3