G
gmclee
hi there,
I am trying to use CGI in my my homepage. The server is running in
win2003 and the network admin said it support ASP as well as
ActivePerl. I have no idea what CGI and perl is before I read a brief
introduction of CGI. I have written a simple perl to test if it works
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "It works fine";
exit;
Of course, it works fine. However, I would like to write the CGI in C
language. I try the following code and compile it into test.exe,
renamed as test.cgi
#include <stdio.h>
int main(int argc,char ** argv,char ** arge)
{
printf("content-type:text/html\r\n\r\n");
printf("abc\r\n<br>");
return 0;
}
However, when I run the program. The server returns
'xxx\cgi-bin\test.cgi' script produced no output
Would anyone please tell me what's going on? Some one told me CGI is
just an interface and can be written in many languages. So why it works
fine for perl code but fail for C?????
Thanks in advance.
I am trying to use CGI in my my homepage. The server is running in
win2003 and the network admin said it support ASP as well as
ActivePerl. I have no idea what CGI and perl is before I read a brief
introduction of CGI. I have written a simple perl to test if it works
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "It works fine";
exit;
Of course, it works fine. However, I would like to write the CGI in C
language. I try the following code and compile it into test.exe,
renamed as test.cgi
#include <stdio.h>
int main(int argc,char ** argv,char ** arge)
{
printf("content-type:text/html\r\n\r\n");
printf("abc\r\n<br>");
return 0;
}
However, when I run the program. The server returns
'xxx\cgi-bin\test.cgi' script produced no output
Would anyone please tell me what's going on? Some one told me CGI is
just an interface and can be written in many languages. So why it works
fine for perl code but fail for C?????
Thanks in advance.