Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

passing parameters from a CGI to another CGI

I have a third party CGI program which can be called using http://myWeb/aCgiProg?nameA=valueA&nameB=valueB.

Just wonder if is it possible to call the CGI program  "aCgiProg" from another CGI program ?  How can I pass parameters from one CGI program to another CGI program?
  • 2
1 Solution
You can use redirect for this.
Your CGI script doing something and then out to the stream
header with:

Status: 301 Moved Permanently
Location: http://site/other_cgi_script?some_params

woseeAuthor Commented:
I have tried to do this (written in C):

printf("Status: 301 Moved Permanently\n\n");
printf("Location: http://site/other_cgi_script?some_params");

Only the string "Location: http://site/other_cgi_script?some_params" printed out but didn't call "other_cgi_sctipt".  

Location - is the part of the HTTP header !
Try this:
printf ("Content-type: text/html\n");
printf ("Status: 302 Moved Temporarily\n");
printf ("Location: http://site/cgi-bin/printenv?uraaa\n\n");

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now