Page 1 of 1

Logging in to remote sites

Posted: Mon Mar 06, 2006 7:41 pm
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!

Posted: Mon Mar 06, 2006 8:10 pm
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. :)

Posted: Mon Mar 06, 2006 8:14 pm
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!

Posted: Mon Mar 06, 2006 10:40 pm
by mickd
cURL you wouldnt assuming the server is running php4+