PDA

View Full Version : return value from server to client


wind0965
02-02-2004, 05:34 PM
I confront a problem to return a value from server side to client after execute the .cgi. And the cgi is written in C.

I don't know if it is possible to do like:
--in C file (save as "test.cgi"):
int main()
{
.....
return result;
}


--in JavaScript:
var test_cgi = 0;
...
test_cgi = "test.cgi" //OR: test_cgi = return test.cgi

It seems not to work.


Or if there are other possibilities?

Thank you in advance!

Jeff Mott
02-02-2004, 06:15 PM
Any program, whether written in Perl, C, or anything else, sends the page content back by printing to STDOUT. e.g.,#include <stdio.h>

int main()
{
printf("Content-Type: text/html\n\n");
printf("Hello, World!");
return 0; // indicates successful execution
}