Results 1 to 4 of 4
Related
-
Doubts using HTTP::Request::Common Forum: CGI Perl Forum
Replies: 0 -
PHP Form Mail Problem Forum: PHP Forum
Replies: 30 -
submit form problem Forum: HTML Forum
Replies: 0 -
Substitute For Request.form In Perl Forum: CGI Perl Forum
Replies: 1 -
Problem with form in IE6 - empty space at end of form Forum: HTML Forum
Replies: 1
-
11-09-2005, 04:58 AM #1
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());
-
11-09-2005, 10:31 AM #2
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!
-
11-09-2005, 11:13 AM #3
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.
-
11-09-2005, 06:18 PM #4
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
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum