How to login to a remote site (username and password), spoof a cookie and download a file (locally to the server)!!
Posted on 2006-11-28
OK, apologies if this seems a lot of work, but it's really not such a big task.
I am hoping for some advice about mecanisms (bonus for some code to do it as well) to do the following things with a PHP script:
1)Call a URL
2)That URL requires a login, so I need to pass a username and password to the input boxes
3)Once logged into that site, I can call a second url (which is the equivalent of clicking a "download" button)
4)Receive the file back to the webserver (a simple CSV file) and store it in the desired location
I cannot confirm whether the site requires cookies or not. If you know anything about cookie spoofing from a server, advice or resources would be appreciated.
This job will then be run on a Cron Job.
Many thanks for your time on this one experts. EE has never ceased to amaze me, I'm sure it won't let me down this time!