Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Expertise: Beginner
Apr 24, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Getting CGI Output

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.

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.



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