CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
passing variables from one script to another..

 



th3monk3y
New User

May 18, 2003, 11:53 PM

Post #1 of 3 (249 views)
passing variables from one script to another.. Can't Post

Hi all,

I have an html form that passes variables to script1.pl .....this script then takes the info and enters it into a database. I need a snippet of code that will then take the variables and pass it to script2.pl. I have been using the following with no luck...



#perl script that takes get and post-params, and give those params to another script

use strict; #force declaration of variables
use CGI; #cgi-package for param-retrieval

my ($query, $key, $external_script, $param_line);

$external_script="myscript.pl";
$query=new CGI;

foreach $key ($query->param) {
#concatenate the parameters to a string
$param_line = $param_line.' '.$key.'='.$query->param($key);
}

system ("$external_script$param_line");

I have also tried hardcoding it, just to see if my variables are hitting script2.pl...

$act="Reg";
$CODE="02";
system("../forums/ikonboard.cgi $act, $CODE");
exit;

no luck there either. both of these are hitting the second script and printing out script2.pl underneath scritp1's output...But not passing the variables.. I sure could use some help on this... very frustrated to say the least!

thanks in advance,

-Paul

p.s. where can I get this nifty html editor?


(This post was edited by th3monk3y on May 18, 2003, 11:54 PM)


blaze
Novice

May 19, 2003, 12:04 AM

Post #2 of 3 (246 views)
Re: [th3monk3y] passing variables from one script to another.. [In reply to] Can't Post

is there any reason you cant just pass them in hidden tags?

<input type="hidden" name="param" value="$scalar">


th3monk3y
New User

May 19, 2003, 12:32 AM

Post #3 of 3 (243 views)
Re: [th3monk3y] passing variables from one script to another.. [In reply to] Can't Post

Thanks for the blazing fast response... no pun Tongue

I am not sure what you mean? From the original html form, or from script1.pl? I guess when I say html form; this is not quite correct...it is a form that is created from a perl script.. the end result is still an html form though... please explain.. I am anxious to get past this hurdle... this is one of those deals when you are working on something else and discover you have to back track and change something only to get stuck!! uhg! Can you include an example?

thanks,

-Paul

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives