32 users online (1 members and 31 guests)  


  Results 1 to 4 of 4

Related

  1. Doubts using HTTP::Request::Common    Forum: CGI Perl Forum
    Replies: 0
  2. PHP Form Mail Problem    Forum: PHP Forum
    Replies: 30
  3. submit form problem    Forum: HTML Forum
    Replies: 0
  4. Substitute For Request.form In Perl    Forum: CGI Perl Forum
    Replies: 1
  5. Replies: 1
  1. #1
    varuna1's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2005
    Posts
    2

    Problem using Http::Request::Form

    Hi Everyone

    I am using the perl script but at the time of calling of this script it gives error at http::request::form. But it is not moving beyond http::request::form.
    Please if anyone could help me to find the problem in the script.

    Thanks.

    =====================================
    #!/usr/bin/perl -w

    use strict;
    use URI::URL;
    use LWP::UserAgent;
    use HTTP::Request;
    use HTTP::Request::Common;
    use HTTP::Request::Form;
    use HTTP::Cookies;
    use HTML::TreeBuilder 3.0;
    use DBI;

    my ($db_table, $db_user, $db_pass) = ("tab", "dbu", "pass");


    my $url = "https://abc.htm";

    my $ua = new LWP::UserAgent;
    push @{ $ua->requests_redirectable }, 'POST';
    $ua->cookie_jar(new HTTP::Cookies(file => "./cookies.txt"));

    my $req = new HTTP::Request(GET $url);
    my $res = $ua->request($req);


    my $tree = new HTML::TreeBuilder;
    $tree->parse($res->content);
    $tree->eof();

    my @forms = $tree->find_by_tag_name('FORM');
    if(!@forms) {
    die "No forms found";
    }

    my $form = new HTTP::Request::Form($forms[0], $url);
    $form->field("{actionForm.username}", "user");
    $form->field("{actionForm.password}", "password");

    $res = $ua->request($form->press());

  2. #2
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: Problem using Http::Request::Form

    why are you using those to handle cookies, and forms and stuff?

    there are much eassier alternatives to doing this!

    btw... make sure your version of perl supports 'ALL' those mods!

  3. #3
    varuna1's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2005
    Posts
    2

    Re: Problem using Http::Request::Form

    Thats the already written code from client and they dont want to change it. We are also beginners in perl so dont know much. In the PHP page when we call this script at that time the script stops responding/crashes. If you could check that the code written is ok or some problem in the syntax then please let us know.

  4. #4
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: Problem using Http::Request::Form

    well, i dont know much about HTTP::REQUEST::Form

    so the only thing i can say is: "i would use traditional ways of getting contents of a form"

    cant help much here,
    -ALL



Tags for this Thread