Call an external PHP file with fake cookie data

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SeriousSamP
Forum Newbie
Posts: 8
Joined: Thu Apr 08, 2010 5:27 pm

Call an external PHP file with fake cookie data

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Call an external PHP file with fake cookie data

Post by Christopher »

Use cURL. See the manual. There is also a library named Snoopy if you do not have the cURL extension.
(#10850)
SeriousSamP
Forum Newbie
Posts: 8
Joined: Thu Apr 08, 2010 5:27 pm

Re: Call an external PHP file with fake cookie data

Post by SeriousSamP »

Thanks that seems to work. :D Kindof. I am having some issues but have started a new thread. :?
Post Reply