homepage Welcome to WebmasterWorld Guest from 107.21.187.131
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
cgi script calling another cgi
syntax help and logic
Jay1025




msg:3862219
 1:13 am on Mar 4, 2009 (gmt 0)

Hi,

I am calling 1 cgi script immediately upon executing another.
The first cgi is a forum script and the immediate one called is the captcha script to weed out bots...and spam.

The first script has a path to perl and then:

require "/usr/local/www/cgi-bin/cgi/captchatest.cgi";

which is the captcha script.
Is the above syntax the correct way to call it so that it branches out? I would like to set a variable back on the pc browsing the site / or set as cookie....and change the logic in the first script to something like...

if a variable is not set on remote pc..branch to captcha script....if it is set continue on.

I am looking for direction on how to do this....and if it's possible in an easy way.

I would then have to set the variable/cookie upon successfully keying in the captcha codes.

I have spent a couple hrs...googling it and am fumbling.

thanks...Jay

 

krugs




msg:3862283
 5:06 am on Mar 4, 2009 (gmt 0)

Is the above syntax the correct way to call it so that it branches out?

Don't really know what you mean by branch, but when you call a script using "require" it pretty much is the same as if the required script is part of the main program.

You can't set a cookie and then check it without reloading the browser. You can check for a cookie when the perl script runs and if your script doesn't find what it needs then do a captcha, something like:


if (no cookie) {
require "captchatest.gic";
}


phranque




msg:3862335
 8:08 am on Mar 4, 2009 (gmt 0)

the require [perldoc.perl.org] perl function includes a library file but doesn't necessarily "execute" anything.

krugs




msg:3862959
 9:49 pm on Mar 4, 2009 (gmt 0)

He was already using "require" to run the captcha script (see his example above) so it should work the same.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved