Need autologin facility to other site.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nilayanand
    New Member
    • Nov 2006
    • 10

    Need autologin facility to other site.

    My page has the link to take user directly to report page of other site. Clicking report link ask user (in browser authentication dialog box) to submit user, password, before showing report page. Our site has the user password stored in database and I just want to submit user/password internally so user won’t be asked for it.
    Is there any way to do it through php?


    Thanks in advance
  • bno
    New Member
    • Nov 2006
    • 8

    #2
    Originally posted by nilayanand
    My page has the link to take user directly to report page of other site. Clicking report link ask user (in browser authentication dialog box) to submit user, password, before showing report page. Our site has the user password stored in database and I just want to submit user/password internally so user won’t be asked for it.
    Is there any way to do it through php?


    Thanks in advance
    store inputted variables with POST method, or could use a session or a cookie to track logged in status?

    Comment

    • swandi
      New Member
      • Nov 2006
      • 13

      #3
      I think you could use curl
      [PHP]
      <?php
      $url = "http://nm.del.ac.id/?act=login";
      $ch = curl_init();
      curl_setopt($ch , CURLOPT_URL,$ur l);
      curl_setopt ($ch, CURLOPT_POST, 1);
      //to enable POST
      curl_setopt ($ch, CURLOPT_POSTFIE LDS,"name=name& password=passwo rd&log=1");
      //set the post value, you need to know the post field in the other site
      curl_exec($ch);
      ?>
      [/PHP]

      Comment

      • TheMadMidget
        New Member
        • Oct 2006
        • 98

        #4
        cURL can pull the data, but can't follow the post via redirecting.

        Comment

        • ctsasikumar
          New Member
          • Nov 2006
          • 17

          #5
          Originally posted by TheMadMidget
          cURL can pull the data, but can't follow the post via redirecting.
          ya same think i want.....it's perl it's possible using
          mechanize; module folow link is there.any one konws auto login in php

          Comment

          • TheMadMidget
            New Member
            • Oct 2006
            • 98

            #6
            If all you want to do is login into a single page and I'm guessing that has it's own form that sends off. If you have the users enter the information that the other page request, basically mimic that page, you can use cURL twice and accomplish the goal. Use both right after each other in the same file and you can login then submit their form. Note: login via cURL does not always work, typically because the remote server check the referer or is trying to set cookies and doesn't because of security reasons.

            Comment

            Working...