I've successfully used CURL to maneuver around and through sites
but a new site I've been trying to work with has got me stumped.
To retrieve the data I'm trying to get a login is required. If
you go to any page in the "member" area without logging in you
get directed to a https connection and hit login.php (ie: you
end up at https://www.domain.com/login.php). The problem, I
believe, lies in the fact that the form on that page references
itself in the form action tag.
The action tag in the form is "/login.php" and nothing I've tried
has been successful in getting CURL to actually submit the data
and get me logged in. Not surprising really since you'd normally
point CURL to the action target to pass form data.
The things I've tried so far without luck are:
* Hit the main site page to pick up the session cookie then go
to one of the "member" only pages
* Gone directly to one of the "member" pages to get redirected
to login.php
Both attempts end up simply returning me the contents of the
login.php page which, obviously, doesn't help or do any good.
What isn't clear from the CURL documentation with PHP is whether
or not the CURLOPT_POSTFIELDS get passed to pages after a redirect
takes place. I suspect they are but the fact that login.php
refers back to itself seems to be the real problem.
If anyone has any ideas on how to convince CURL to get me past
login.php or any other suggestions on things I could try I would
very much appreciate it.
Thanks,
Dave Martin