Gossamer Forum
Home : General : Perl Programming :

simulate a form subition through CGI script.

Quote Reply
simulate a form subition through CGI script.
I wan to make a script that would take the entries of one form and submit them to another script that would use these valuse .

Any ideas ?
Quote Reply
Re: simulate a form subition through CGI script. In reply to
You should be able to pass the variables received by one script to the other script by just jumping to it. Let's assume you have three variables passed to script1 that you want to pass to script2 without creating a second form to do it. The fields have been assigned to the @fields array in script1 as var1, var2, and var3:

Code:
$param ="var1=$fields{'var1'}&var2=$fields{'var2'}&var3=$fields{'var3'}";
$goto = "cgi-bin/script2.cgi?$param";
print "Location: $goto\n\n";

I haven't tested this code, but it does look right and should work.


[This message has been edited by Bobsie (edited August 26, 1999).]
Quote Reply
Re: simulate a form subition through CGI script. In reply to
Hi Bobsie,
Thank you for your reply, but what i mean was that i wanted to do it INTERNALLY, without the browser having to do anything, .
i.e. the first script will call the second script and pass the variables to ti or just use the subroutines in the second script.
all this needs to be done inside the server, and the user shouldnt be able to see it .

can it de done?
Thanks