[CTS] Re: GGI runs CGI

  • From: John Madden <weez@xxxxxxxxxxxxx>
  • To: computertalkshop@xxxxxxxxxxxxx
  • Date: Thu, 28 Mar 2002 18:51:01 -0500

> The idea is to create a censor script that filters link page submissions
> (to get around the sneaky page spammers who won't get to the real script
> until they pass the censor). It does that, but since it uses the
> variables provided from a link page form, those variables become
> unavailable to the second script (drat!). I know they are filled in
> correctly.

Right - the problem is that those variables are passed to the first script 
using CGI - in other words, something like 
http://host/path/to/script.pl?var1=something&var2=something+else

That's where "becoming a HTTP client" comes in.  If you really need to 
call the second script, I suggest you pass the args to the script as 
command line arguments:

system("/path/to/script2.pl", "arg1", "arg2"); 

and utilize them inside script2.pl as $ARGV[0] and $ARGV[1].  But please, 
please note: using system() can be *extremely* dangerous.  You're 
executing something at the shell here - security first.  If there's any 
other way of using the code in the second script (copy the code from it 
into the first, for example), I suggest you take that route.

John




-- 
# John Madden  weez@xxxxxxxxxxxxx ICQ: 2EB9EA
# FreeLists, Free mailing lists for all: //www.freelists.org
# UNIX Systems Engineer, Ivy Tech State College: http://www.ivy.tec.in.us
# Linux, Apache, Perl and C: All the best things in life are free!
---------------------------------------------------------------------------
-----
Computer Talk Shop http://www.computertalkshop.com
Un-subscribe/Vacation, http://questforcertification.com/cts/list_options.htm

List HowTo: http://questforcertification.com/cts/faq

To join Computer Talk Shop's off topic list, please goto:
http://questforcertification.com/cts/other_cts_lists.htm
---------------------------------------------------------------------------
------

Other related posts: