Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language:
Expertise: Beginner
Apr 24, 2000

Getting CGI Output

Question:
Using C or C++ for CGI programs, is there a way to make a CGI program that calls another CGI program, and then takes the output of that called CGI program, and displays (to the client only) some selected text from the output of the called CGI program? For example, A CGI program that can use the Yahoo CGI program to display to the user only the first search result of a Yahoo search.

Answer:
A CGI program is a process, and as such, it has a distinct address space. Therefore, you can't pass values directly from one CGI program to another unless you use some sort of interprocess communication (IPC), such as, sockets, shared memory or pipes. However, you can avoid the hassles of IPC by writing the results of the first CGI program into a file and then have its caller read the data from that file, filter it, and display it to the user.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date