Logging in to remote sites

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
Yonderknight
Forum Commoner
Posts: 31
Joined: Sun Jun 13, 2004 6:51 pm

Logging in to remote sites

Post by Yonderknight »

Hi everyone,

I was wondering if it would be possible to have PHP script to log into a remote website (where you'd usually log into a form of some sort). I tried researching into sending POST variables to a URL, and found some complicated stuff with fsockopen and headers and stuff... I tried to understand as much as I could of it never seeing headers before, and eventually found several functions to try to do the process for me. One worked, however it returned what looked like another sort of header with some cookie information or something.

Even if I did get a page returned, and found some links on it, how would I continue browsing the rest of the site? Could I use something like File_Get_Contents() for going through links? Would it still recognize me as being "logged in" the site?

Any help will be appreciated!

Thank You!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

cURL, Snoopy, and some others can be used to make post submissions. I don't remember off hand if Snoopy can store cookie information, but I know cURL can.

We've had a few threads dealing with cURL and cookies, search them out and try a few things. Post back if you have further questions. :)
Yonderknight
Forum Commoner
Posts: 31
Joined: Sun Jun 13, 2004 6:51 pm

Post by Yonderknight »

Well, I was hoping I wouldn't need to make any extra installations, its not running on my server.

(would I need to make an installation?)

Thanks so much!
mickd
Forum Contributor
Posts: 397
Joined: Tue Jun 21, 2005 9:05 am
Location: Australia

Post by mickd »

cURL you wouldnt assuming the server is running php4+
Post Reply