Page 1 of 1

Call an external PHP file with fake cookie data

Posted: Thu Apr 08, 2010 5:45 pm
by SeriousSamP
Hi,
I am kindof new with PHP but I code javascript and I think I can pick it up. I am trying to call a PHP file located on an external server, probably using some kind of include, and pass some data to it in order to complete a task. I am then going to run this on a cronjob. The problem is that this site requires that you login using the Twitter Oauth login before you can do this. The easiest way I can see of getting round this is to fake the cookie data when you run the include. However being a PHP newb I cannot work out if this is even possible although I find it likely that it is. Any help would really be appreciated even if you're just telling me it's not possible. Also, if anyone knows of a better way of doing this without the cookie thing then that's great.

Thanks people,
SeriousSamP

Re: Call an external PHP file with fake cookie data

Posted: Thu Apr 08, 2010 10:18 pm
by Christopher
Use cURL. See the manual. There is also a library named Snoopy if you do not have the cURL extension.

Re: Call an external PHP file with fake cookie data

Posted: Fri Apr 09, 2010 9:21 am
by SeriousSamP
Thanks that seems to work. :D Kindof. I am having some issues but have started a new thread. :?