Actually, I am a member of the community. My user name is mak

I remembered to login just after I posted my message :). Let me post my message again WITH formating :)

Here is the mssage

--------------------------------------------------

Hello, First, I thank all who helped me on my previous postings. It was a great deal of help. But I still have problems :) I was able to login the page once with the code belowe. Now it says that session has been expired. I copied this code from one of the replies. Am I doing somthiong wrong in when simulating a login? I am passing all the paramaters to the url
($url->query_form( artist => $pm_user, albumcode => $pm_password);

Those are the only parameters to be passed. BTW, can someone tell me how to format the message, specially the the code, nicely like eveyone else does? Thanks in advance

#!/usr/bin/perl -w use strict; use LWP::UserAgent; use URI::URL; use HTTP::Cookies; # put your perlmonks username and password here my $pm_user=''; my $pm_password=''; #instantiate new user agent my $WWWAgent = new LWP::UserAgent(); # attach cookiejar to user agent my $co=new HTTP::Cookies(file=>'./cookies.dat',autosave=>1); $WWWAgent->cookie_jar($co); # build request to simulate login my $url=new URI::URL 'http://www.genesisreports.com/genesis/user/login +.asp'; $url->query_form( artist => $pm_user, albumcode => $pm_password); my $WWWRequest = new HTTP::Request 'GET', $url->as_string() ; # submit request my $WWWResult = $WWWAgent->request($WWWRequest); open (FH, ">D:\\Mustafa\\Perl\\Code\\dm.html") || die "Can't open file to write\n"; print FH $WWWResult->content if ($WWWResult->is_success); close(FH); die "Error logging in $WWWResult->code $WWWResult->message" if(!$WWWR +esult->is_success); #Get the login page content to test $url=new URI::URL 'http://www.genesisreports.com/genesis/user/mypage.a +sp'; $WWWRequest = new HTTP::Request 'GET', $url->as_string() ; # submit request $WWWResult = $WWWAgent->request($WWWRequest); open (FH, ">D:\\Mustafa\\Perl\\Code\\dm1.html") || die "Can't open file to write\n"; print FH $WWWResult->content if ($WWWResult->is_success); close(FH); die "Error adding to nodelet $WWWResult->code $WWWResult->message" if( +!$WWWResult->is_success);

In reply to Re: Re: Accessing protected documents again by mak
in thread Accessing protected documents again by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.