develooper Front page | perl.libwww | Postings from February 2001

post woes

From:
Chris Martino
Date:
February 26, 2001 12:13
Subject:
post woes
Message ID:
Pine.LNX.4.32.0102131340590.27251-100000@stupid.console.org
Hi-

I'm writing a script to login to surepay and access some data.  I'm trying
to reuse some other code that works successfully for other websites, but
it isn't working for this site.

Here's what I'm using:

--- BEGIN ---

#!/usr/bin/perl -w
use HTTP::Request::Common;
use LWP::UserAgent;
use HTTP::Cookies;

$ua = LWP::UserAgent->new();
$ua->agent("Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
$ua->timeout(600);

$response = $ua->request(POST "https://www.surepaymanager.com/index.cfm",
        ['globalUser' => "false",
        'loginerror' => "true",
        'MerchantIDIn' => "id",
        'PasswordIn' => "pass",
        'UserIDIn' => "Admin%20Login"]);
$ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt", autosave =>
1));

print $response->as_string;

--- END ---

Here's the response I get back:

--- BEGIN ---

chris@black ~/scripts > ./surepay2.pl
HTTP/1.1 200 OK
Date: Mon, 26 Feb 2001 20:11:04 GMT
Server: Netscape-Enterprise/3.6 SP3
Content-Type: text/html
Client-Date: Mon, 26 Feb 2001 20:18:45 GMT
Client-Peer: 216.136.147.17:443
Client-SSL-Cert-Issuer: /C=US/O=Entrust.net/OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Secure Server Certification Authority
Client-SSL-Cert-Subject: /C=US/ST=California/L=Redwood City/O=First Data
Corporation/OU=Commerce Equipment Operation/CN=www.surepaymanager.com
Client-SSL-Cipher: DES-CBC3-SHA
Client-SSL-Warning: Peer certificate not verified
Page-Completion-Status: Normal
Page-Completion-Status: Normal


        <form name="the_form" action="error.cfm" method="post">

                        <input type="hidden" name="message" value="Login
incorrect.  Please re-enter your user ID and password.<br><br>If your
browser does not accept cookies please reconfigure it so the Cookies can
be turned on in Netscape by going to Edit->Preferences and in Internet
Explorer by going to View->Internet Options.">
                        <input type="hidden" name="cfid" value="71620">
                        <input type="hidden" name="cftoken" value="5145865">
                        <input type="hidden" name="deletecookie" value="true">
                        <input type="hidden" name="loginerror" value="true">

                <script>document.the_form.submit();</script>
        </form>

--- END ---

I know this is a pretty specific problem, but perhaps I am overlookinf
something.  That's where all you guys come in. :)

TIA,
C




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About