cgi script calling another cgi

syntax help and logic

New User

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.

Junior Member

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: