The following script is an attempt to automate the remote administration of my website using LWP. It attempts to submit the fields 'email' and 'passwd.'
# Jonathan S. Mark jonathansamuel@yahoo.com
# Program to log on to Alxnet
use strict;
use LWP;
use HTTP::Request::Common;
use constant ALX_ENTER => 'http://www.alxnet.com/controlcenter/';
use constant ALX_REFERER => 'http://www.alxnet.com';
my $ua = LWP::UserAgent->new;
my $newagent = 'enter_alxnet/1.0 (' . $ua->agent . ')'; #identifies ap
+p to net. Not important.
$ua->agent($newagent);
my $request = POST (ALX_ENTER, Content => [email => 'jonathansamuel@ya
+hoo.com', passwd => 'subforactualvalue', t => 'alxnet_signup'], Refer
+er => ALX_REFERER);
my $response = $ua->request($request)->as_string;
print $response;
Unfortunately, running this LWP script returns a message from the server similar to the following:
HTTP/1.1 302 Found
Cache-Control: no-cache, must-revalidate
Connection: close
Date: Sun, 12 Aug 2001 10:31:11 GMT
Pragma: no-cache
Location: /controlcenter/?u=100000&p=0x1000000000000
Server: Apache/1.3.17 (Unix) PHP/4.0.4pl1 mod_perl/1.25
Content-Type: text/html
Expires: Mon, 26 Jul 1990 05:00:00 GMT
Last-Modified: Sun, 12 Aug 2001 10:31:13GMT
Client-Date: Sun, 12 Aug 2001 11:38:28 GMT
Client-Peer: 209.92.32.185:80
Can anyone clue me in what is going on here. What does 'no-cache, must revalidate' mean? What do I have to do using LWP to avoid this problem?