[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

Logging in to secure site with cURL or post_it and dealing with redirects

Asked by TylerRick in PHP Scripting Language

Tags: curl, post_it

I'm trying to get information from a site that requires one to log in--all from a PHP script. The first step is then to log in via the script. I've found several tools that look like they should be able to do this task--post_it and cURL looking the most promising--but I'm having problems.

When I use post_it, I'm able to "log in" (specifying my user name and password, etc. and doing a "post" to the site) to this site and get a page returned to me that says it is "connecting to mainframe". (I get the same page returned to me when I do the post with "curl -d [login data] [url]".) The problem then is that the page isn't really what I need and apparently it gets redirected until it finally reaches the main menu page. Here is a snippet from the end of the page it returns:


<form method="POST" action="Validate_User.asp" id="ValidatePage" name="ValidatePage">

</form>

</body>
</html>

     <script LANGUAGE="JavaScript">
     <!--
//          function CheckErrors()  /* this function runs on focus of the form to get the users local date */
//          {
               window.location.href = "default.asp";
               //alert("Hello John")
//          }    
      // -->
     </script>

   
which somehow must try to forward to a page called default.asp. And I don't know how to "follow" the pages after this point. (A browser, of course, is able to follow redirects and all just fine, but can all that stuff be followed with a PHP script?) I get the page saying it is trying to connect just fine, but what happens after it is done connecting? The page I get passed to me doesn't even tell me whether the login/password were accepted--only that it's attempting to connect.

So if anyone could help me with what to do next, I'd really appreciate it. It probably doesn't help that they appear to use JavaScript to do their redirection (wouldn't some server side redirect function or a server-originated HTTP header to redirect be better than a silly JavaScript "href="?)

I don't even know why it tries to redirect to "default.asp". That seems to be the page that I started with (the login page) though, so I have no idea why it would want to return me there.

Here is the path (the pages) apparently taken when I log in with the browser.
default.asp -- the page with the login form, it submits it to the next page, which is
Validate_User.asp -- the "action" of the form -- don't know what goes on at this page, but eventually I end up at the next page, which is
MainMenu.asp -- when I log in normally with a web browser, this is where I end up, the main menu presented to authenticated users

How do I get to the last page (MainMenu.asp) in PHP by submitting a login post (or by some other way if that's not how it's done)?
[+][-]05/16/02 02:31 AM, ID: 7013293Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: PHP Scripting Language
Tags: curl, post_it
Sign Up Now!
Solution Provided By: RQuadling
Participating Experts: 1
Solution Grade: A
 
[+][-]05/14/02 02:58 AM, ID: 7008106Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/14/02 02:58 AM, ID: 7008108Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/14/02 02:57 PM, ID: 7009754Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/14/02 04:26 PM, ID: 7009861Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/14/02 05:07 PM, ID: 7009895Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/14/02 05:09 PM, ID: 7009899Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/14/02 05:09 PM, ID: 7009900Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/14/02 05:10 PM, ID: 7009902Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/14/02 05:10 PM, ID: 7009903Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/14/02 05:11 PM, ID: 7009904Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 01:32 AM, ID: 7010501Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/15/02 03:51 PM, ID: 7012515Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 03:53 PM, ID: 7012518Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 04:03 PM, ID: 7012533Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 04:03 PM, ID: 7012534Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 04:04 PM, ID: 7012535Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 04:04 PM, ID: 7012536Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 04:07 PM, ID: 7012545Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 04:10 PM, ID: 7012549Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 04:10 PM, ID: 7012551Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 04:15 PM, ID: 7012560Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 04:23 PM, ID: 7012575Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 04:38 PM, ID: 7012605Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/02 04:53 PM, ID: 7012623Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/16/02 01:14 AM, ID: 7013179Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/16/02 01:16 AM, ID: 7013183Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/16/02 01:19 AM, ID: 7013188Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/16/02 01:21 AM, ID: 7013189Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/16/02 04:22 PM, ID: 7015171Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93