passing variables

i have this form which has predefined names and values embedded in it, but there are some values that the user can enter... i want to write a script that logs and/or emails those variables and then plug them into another script... kinda like: etc

if anyone could give me tips on how i could do this or if i'm making any sense (i've just begun learning basic perl and cgi stuff) or just point me in the right direction, it'd be a great help!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If I am understanding you, it sounds like you want to set a
header, or a <META HTTP-EQUIV="REFRESH"> tag
Or else fetch the URL yourself, which can be be done with perl modules like
use LWP::Simple;
use LWP::UserAgent;
If you use FrontPage Express you can
drop a Submit button, and at forms properties click Settings then write your CGI executable file at Action edit box, select method of sending these values (Post or Get) I prefere Post, because it is more secure, by it you can send password, but you cann't if you use Get, because the password will appear at Address area. when the user open this page and enter some data in different fields then he/she click on Submit button all these data will be sent to your CGI or PERL application.

KennyIT Application ExecutiveCommented:
Hope this helps you out :

####### In your HTML :

<form method=post>

######## In your CGI :


# To handle input from forms / URL

#Putting the Query_string into a variable
      if ($ENV{'REQUEST_METHOD'} eq POST)
            read (STDIN, $QueryString, $DataLength);
            $QueryString = $ENV{'QUERY_STRING'};

#Splitting the pairs and putting them in a list
      @NameValuePairs = split (/&/, $QueryString);

#Preparing for HTML stuff
      open (LOG, ">>log.txt");
      print "Content-type: text/html","\n\n";      # MIME header

      print "<HTML>","\n";
      print "<HEAD>","\n";
      print "<TITLE>","Parameters sent in","</TITLE>","\n";
      print "</HEAD>","\n\n";
      print "<BODY>","\n\n";
#Separating the pairs and displaying them on screen.

      $n = 0;
      foreach $NameValue (@NameValuePairs)
            ($Name, $Value) = split (/=/, $NameValue);
            $Value =~ tr/+/ /;
            $Value =~ s/%([\dA-Fa-f][\dA-Fa-f])/ pack ("C", hex ($1))/eg;

            print LOG "Variable=$Name, Value=$Value <BR>\n";
            print "Variable=$Name, Value=$Value <BR>\n";

      print "</BODY>","\n\n";
      print "</HTML>","\n\n";

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

if you want to plug them into another script then yo could write your first script like the one above, but put a form in the returned webpage.

this form should have a hidden field for each value that you want to pass onto the next script, and the submit button should call your new script.

that will pass them onto the new script.
sayhiAuthor Commented:
ok, i've got a good start with all your comments, BUT i only want to record what the user inputs, can u record only certain variables?
another thing is this LWP module, i looked it up and think it's for people who have there own server. how do i check if my webhosting provider has this module? or can i install this in my directory?

if i can't use this, what's the way to redirect to another URL within the cgi script?
sayhiAuthor Commented:
well, i figured out how to get the variables i want by doing @userinput = @formdata{'input1', 'input2'};

i think i'll do a little more reading and see what i can do ;)
sayhiAuthor Commented:
ok this is what i've came up:


require "subparseform.lib";

print "Content-type: text/html\n\n";

@userinput = @formdata{'input1', 'input9'};

$input1 = @formdata{'input1'};
$input9 = @formdata{'input9'};

open (LOG, ">>log.txt");
print LOG "@userinput\n";

#go to 2nd cgi
print <<"REDIRECT";
      <META HTTP-EQUIV="refresh" CONTENT="0; URL=$input1&field2=....&field9=$input9&field10=">


And it works!

still, i've got one more question... how could i do this with the post type method? i know it might have to do something with STDIN.

i am splitting the points on this question, per the users request, the points will be broke like this :

ozo > 65
Motaz > 50
zxr250 > 65
BillyAbbott > 20

Each expert will find their questions posted in this area.

Community Support @ Experts Exchange

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.