Solved

using cgi to auto submit a web form

Posted on 2002-06-06
2
409 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 50 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…

789 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