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!
I want to login into facebook with a valid username and password. My goal is to get the contents of user's home page.
I am using curl for my http requests and I know how to use curl cookies.
My question is: What is the exact http request for logging in to facebook?
All I want is to be able to get the html source of a user's (with known username/password) home page in facebook by php code! Any trick that does this is welcome!
it isn't that easy unfortunately. if there is a login form, there may be hidden vars that need be present. sometimes a login is sen to another page, your curl may not be following. sometimes the server insist on browser referal tag.
best you study the login form and observe the headers sent by server in your attempts. in some servers, it is just not possible to get in by curl due to implemented security algorithms.
James.J wrote:But I am able to login to other websites using curl (e.g. to google) with not that much efforts! So, what would one do if they want to get the contents of a facebook page which needs authorization? Any method (php ofcourse) that does this will be my answer!
google is of course easy. but each website uses a different login script.
James.J wrote:What would you do if you wanted to write a browser using php? My problem is much simpler I guess ...
curl is of course the way, but what i said was, it does not mean you can get into all sites that way. some sites don't allow that.