?
Solved

using cgi to auto submit a web form

Posted on 2002-06-06
2
Medium Priority
?
415 Views
Last Modified: 2012-08-14
I am having diffculties in writing a cgi script to auto submit to a web sms form in this web site url http://home.singtel.com/msg_center/sms/

Pls let me know how do I go about programming it, some sample source code would be helpful.



0
Comment
Question by:ghgan
2 Comments
 
LVL 4

Accepted Solution

by:
dda earned 200 total points
ID: 7061169
Something like this:

#!/usr/bin/perl

use strict;

use HTML::Form;
use LWP;

my $ua = LWP::UserAgent->new();

my $url = 'http://your.server.xxx'; #
my $login_req = HTTP::Request->new(GET => $url);
my $login_res = $ua->request($login_req);
my $html = $login_res->content;

my $form = HTML::Form->parse($html,$url);
$form->value('login','yourlogin');
$form->value('password','yourpass');
$form->value('action','login');
my $req = $form->click;

my $res = $ua->request($req);
0
 
LVL 8

Expert Comment

by:inq123
ID: 9512501
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept a comment by dda

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

inq123
EE Cleanup Volunteer
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question