echoangel911 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, I have this CGI website and I have a link to another website. When people click on this website, a windows window will appear asking them to fill in the username and password. I know a general account already. How can I automatically fillin the username/password and proceed directly to the other website? thanks

Replies are listed 'Best First'.
Re: Perl Cgi Login Question
by davorg (Chancellor) on Aug 22, 2006 at 14:13 UTC
      Hello, I was able to get data from using
      use LWP::UserAgent; $ua = LWP::UserAgent->new; $req = HTTP::Request->new(GET => 'http://www.linpro.no/secret/'); $req->authorization_basic('aas', 'mypassword'); print $ua->request($req)->as_string;
      however, how do you access the orignal site that I want go to instead of me retrival data from the site?
        In essence you don't. Because the authentication has been granted to your CGI script, not to the user.
Re: Perl Cgi Login Question
by dorward (Curate) on Aug 22, 2006 at 14:11 UTC

    The short answer is "You can't"

    The longer answer discusses the risky username:password syntax and points out that its probably not a good idea to try to use it.

    The only way the CGI could provide the user with access to the data would be to act as a proxy (fetching data from the site, rewriting links et al to pass through the CGI and then passing it on to the user)

A reply falls below the community's threshold of quality. You may see it by logging in.