J
John Bokma
The following script used to work (Logs in to a PHPbb message board):
use strict;
use warnings;
use LWP::UserAgent;
use LWP:ebug qw(+);
my $ua = LWP::UserAgent->new();
my $response = $ua->post(
"http://toxicice.com/login.php", [
username => 'xxxxxxx',
password => 'xxxx',
autlogin => 'off',
redirect => '',
login => 'Log in',
]
);
$response->is_success or
die "Login failed: ", $response->status_line, "\n";
With an invalid username/password (as above), it gives:
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: POST http://toxici
LWP::UserAgent::_need_proxy: Not proxied
LWP:rotocol::http::request: ()
LWP:rotocol::collect: read 398 bytes
.... snipped ...
LWP:rotocol::collect: read 188 bytes
LWP::UserAgent::request: Simple response: OK
However, with a valid one it gives:
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: POST http://toxicice.com/login.php
LWP::UserAgent::_need_proxy: Not proxied
LWP:rotocol::http::request: ()
LWP::UserAgent::request: Simple response: Found
Login failed: 302 Found
$response->content is empty ('').
I updated some time ago to a more recent version of ActiveState Perl,
and probably LWP was upgraded as well. OTOH it might be a server thing.
perl -v
....
This is perl, v5.8.7 built for MSWin32-x86-multi-thread
....
query *
....
libwww-perl [5.803.0.1] Web API for Perl
....
(Complete script is at:
http://johnbokma.com/perl/phpbb-remote-backup.html )
( If you want to test but have no PHP board, mail: phpbb at johnbokma
dot com, and I arrange a test log in, don't create a test login
yourself, thanks )
use strict;
use warnings;
use LWP::UserAgent;
use LWP:ebug qw(+);
my $ua = LWP::UserAgent->new();
my $response = $ua->post(
"http://toxicice.com/login.php", [
username => 'xxxxxxx',
password => 'xxxx',
autlogin => 'off',
redirect => '',
login => 'Log in',
]
);
$response->is_success or
die "Login failed: ", $response->status_line, "\n";
With an invalid username/password (as above), it gives:
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: POST http://toxici
LWP::UserAgent::_need_proxy: Not proxied
LWP:rotocol::http::request: ()
LWP:rotocol::collect: read 398 bytes
.... snipped ...
LWP:rotocol::collect: read 188 bytes
LWP::UserAgent::request: Simple response: OK
However, with a valid one it gives:
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: POST http://toxicice.com/login.php
LWP::UserAgent::_need_proxy: Not proxied
LWP:rotocol::http::request: ()
LWP::UserAgent::request: Simple response: Found
Login failed: 302 Found
$response->content is empty ('').
I updated some time ago to a more recent version of ActiveState Perl,
and probably LWP was upgraded as well. OTOH it might be a server thing.
perl -v
....
This is perl, v5.8.7 built for MSWin32-x86-multi-thread
....
query *
....
libwww-perl [5.803.0.1] Web API for Perl
....
(Complete script is at:
http://johnbokma.com/perl/phpbb-remote-backup.html )
( If you want to test but have no PHP board, mail: phpbb at johnbokma
dot com, and I arrange a test log in, don't create a test login
yourself, thanks )