You can do something like this:
<input type="hidden" name="B" value="A">
(Embed this in the HTML output by cgi(a).)
Then you can simply access it like any other variable
when processing cgi(b), as so:
$b = $q->param('B');
# $b=='A' in the above example.
-- Glenn
You can pass with form input and you can pass with a hyperlink
To pass default data just use ?$variable and then pick up in the environmental variable in script b
Couple easy ways to do this
Form Method
print "<FORM ACTION=add2.cgi?$user METHOD=POST>";
In this example I am sending the form data and also the $user variable to another script.MAKE SURE YOU DONT PUT QUOTES AROUND ANYTHING INBETWEEN THE < > OR YOU WILL GET AN ERROR
Hyperlink Method
print "<A HREF='add.cgi?$user'>YES</A>";
iN THIS EXAMPLE WHEN THE PERSON CLICKS ON THE YES LINK, IT SEND THE $USER VARIABLE TO THE NEXT SCRIPT
Next, how to retrieve this data in the next script. It is stored in an enviromental variable named "Query String"
#Script B
$variable =$ENV{'QUERY_STRING'};
Voila, your variable you passed from script A, is stored in the enviromental variable Query String which you then pick up in the next script and assign to another variable for use.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.