Gossamer Forum
Home : General : Perl Programming :

perl script passing variable into forms question

Quote Reply
perl script passing variable into forms question
ok..im not exactly sure how to do this...so i need a hand..

i want to make a .pl script so that when i type it in the console it'll pass arguments into a cgi form on a website. ( so i dont have to launch a browser )

ie..

website www.foobar.com has a form.cgi method post with 3 classes in it... class=first, class=second, class=thrid

so how do i make it so i can pass lets say arguments 1,2,3 into the value of the 3 classes....

how do i even start?



thanx in advance.
Quote Reply
Re: [papajohns] perl script passing variable into forms question In reply to
Something like this maybe?

Code:
#!/usr/bin/perl

use strict;
use CGI;

my $IN = new CGI;

my $field1 = $IN->param('field1');
my $field2 = $IN->param('field2');
my $field3 = $IN->param('field3');
my $field4 = $IN->param('field4');
my $field5 = $IN->param('field5');


print $IN->header();

print qq|

<html>
<body>

<input type=text value="$field1" name=field1> <BR>

<input type=text value="$field2" name=field2> <BR>

<input type=text value="$field3" name=field3> <BR>

<input type=text value="$field4" name=field4> <BR>

<input type=text value="$field5" name=field5> <BR>

</body>
</html>

|;

Unsure

That will basically allow you to do stuff like;

http://www.site.com/cgi-bin/form.cgi?field1=valuehere&field2=another_value ... etc.

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

Last edited by:

Andy: Oct 22, 2003, 1:23 AM
Quote Reply
Re: [Andy] perl script passing variable into forms question In reply to
mm..intersting...and then pass the entire thing through html:parser maybe so i can connect to the site with the script and pass the entire content?
Quote Reply
Re: [papajohns] perl script passing variable into forms question In reply to
CGI::Application may be of interest to you.

- wil
Quote Reply
Re: [Wil] perl script passing variable into forms question In reply to
got the answer i needed.. for those who wants to know...i used..

#!/usr/bin/perl -w
use CGI;
use LWP::Simple;
use strict;
my $link = "http://www.wunderground.com/...Forecast?query=60555";

my $result = get ($link);

print "$result";