[PHP]Parsing pages

Joined
Aug 6, 2009
Messages
2,141
Reaction score
434
I am trying to make a script which will parse some info from http://www.centraldispatch.com/

I need to use curl with post methods. So far it work, but after login it shows main page. The thing is that I need to go to other page after login and then parse.

If I parse page that i need "http://www.centraldispatch.com/order.htm" with post value for login then it parses main page after login as well.

Then how can I solve it? :?:
 
What exactly is the problem?

You're trying to go to a page that requires you login first, so you want to POST to login, then navigate to that page and parse it?

You'll need to act like a browser (not sure if cURL supports tracking session cookies). Take the 200 response from your POST and check if it's a valid authentication (print out the output to test). Then, once you know it works, pull the session variable they give you out (the cookies set in the HTTP headers), then add the cookie to your next GET request so the server can look up your session, it should let you nav to the protected page.
 
Back