Specials | Announcements | Contact | Site Map
Willmaster.com
Hijack-proof forms. Surveys. List building.

Solid, safe website tools.

Whatever your need, Will Bontrager builds powerful software solutions.

Affiliate Cookie Setter
Search WillMaster.com:

WillMaster > Support > CGI Q&A

If you don't find the answer to your question in these archives, ask your CGI question at the Current Master Series CGI Forum.

invoke other cgi scripts

Author Message
19Nov01

Srinivas
Subject: invoke other cgi scripts

Hi,
How do I invoke other cgi programs from a cgi script based on user input? I do not want to print a link that calls the program on being clicked ,instead i want the program to call one of the other cgi programs by itself.

Srinivas

19Nov01

Srinivas
In response to: invoke other cgi scripts

Srinivas, use function exec or function system.

These two functions can introduce security risks into your script if used without discretion.

Ensure that form data is not passed directly into the functions. Either scan the form data for valid information or don't use it in the function at all.

If you must pass the form data to the other script, use an array argument to the functions rather than a scalar. A scalar will cause the shell to parse the argument for metacharacters. A cracker could do your system damage with metacharacters.

Depending on your implementation, other security considerations may exist. For example, is it best to avoid accepting program, directory, or file names with a form and using them in exec or system without first testing them for validity and ensuring the data is benign.