From the LWP::UserAgent docs:
$ua->credentials( $netloc, $realm, $uname, $pass )
Set the user name and password to be used for a realm. It is
often more useful to specialize the get_basic_credentials()
method instead.
I've not tried this, but LWP certainly supports it. | [reply] |
Hi Scottj,
Thank's for your reply, I was kind of hoping I would get by without needing to install modules, due to my hosting facilities. I realize now it's not that simple.
pip
| [reply] |
I would think so
(if i understand your question correctly i.e)
Try LWP or WWW::Mechanize (modules and docs at cpan.org.
or you could try wget
rgds
| [reply] |
Hi Chimni,
Thanks for your reply!
| [reply] |
Other people have mentioned how to access password protected pages from a Perl script as a client. Is this what you are asking about?
Or do you want a HTML login form and CGI script that provides access to a password protected site? It is possible to have a CGI script redirect to a URL containing the username and password.
my $url = 'http://' . $username . ':' . $password '@' . 'www.example.c
+om/some_page.html';
print $cgi->redirect($url);
The problems are that this exposes the password in the URL bar. Putting it in frames can make it less obvious but it is still there. Also, a recent update to IE removes all support for usernames and passwords in http URLs. This completely stops any login script from working.
| [reply] [d/l] |
Note that the above trick also works if you are using LWP::Simple. And the update to IE doesn't affect LWP at all.
| [reply] |
Thanks for your help, Tilly, as mentioned on my other replies, unfortunately I cannot install any modules on my server.
pip
| [reply] |