Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

passing parameters from a CGI to another CGI

Posted on 1998-10-21
3
Medium Priority
?
217 Views
Last Modified: 2013-12-25
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?
0
Comment
Question by:wosee
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
Strange earned 300 total points
ID: 1829236
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

0
 

Author Comment

by:wosee
ID: 1829237
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".  

WHY????
0
 
LVL 1

Expert Comment

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

0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question