Re: C++ CGI script

2010-12-15 Thread Ivan Nudzik
Save your time with http://www.webtoolkit.eu/wt when you are in mindset to write CGIs in C++... ;-) On Mon, 2010-12-13 at 22:18 +0100, Jean-Francois wrote: > Hello, > > Sorry for posting basic question here, would you please let me know why such > script does'nt work (error with "Premature end o

Re: C++ CGI script

2010-12-14 Thread a . velichinsky
On Mon, Dec 13, 2010 at 04:44:30PM -0500, Ted Unangst wrote: > endl is "\n", you want "\r\n". no. the httpd server is supposed to do that conversion. that should work. the OP probably messed up something (renamed the c++ source instead of the executable to .cgi?) > On Mon, Dec 13, 2010 at 4:18 P

Re: C++ CGI script

2010-12-13 Thread Francesco Vollero
Il 14/12/10 00.44, Francesco Vollero ha scritto: Il 13/12/10 22.56, Gerhard Hoffmann ha scritto: endl is a so-called manipulator in C++. It outputs '\n' and flushes the output buffer (using the flush method in the stream). So, I would change the order: cout<< "Content-type: text/plain"<< end

Re: C++ CGI script

2010-12-13 Thread Francesco Vollero
Il 13/12/10 22.56, Gerhard Hoffmann ha scritto: endl is a so-called manipulator in C++. It outputs '\n' and flushes the output buffer (using the flush method in the stream). So, I would change the order: cout<< "Content-type: text/plain"<< endl<< endl<< "Hello, World!"<< endl; Since the

Re: C++ CGI script

2010-12-13 Thread Gerhard Hoffmann
endl is a so-called manipulator in C++. It outputs '\n' and flushes the output buffer (using the flush method in the stream). So, I would change the order: cout << "Content-type: text/plain" << endl << endl << "Hello, World!" << endl; Don't know if that solves it. Regards On Mon, Dec 13, 2010

Re: C++ CGI script

2010-12-13 Thread Francesco Vollero
Il 13/12/10 22.18, Jean-Francois ha scritto: Hello, Sorry for posting basic question here, would you please let me know why such script does'nt work (error with "Premature end of script headers") ? #include using namespace std; int main() { cout<< "Content-type: text/plain"<< endl<< endl<<

Re: C++ CGI script

2010-12-13 Thread Ted Unangst
endl is "\n", you want "\r\n". On Mon, Dec 13, 2010 at 4:18 PM, Jean-Francois wrote: > Hello, > > Sorry for posting basic question here, would you please let me know why such > script does'nt work (error with "Premature end of script headers") ? > > > #include > using namespace std; > > int main

C++ CGI script

2010-12-13 Thread Jean-Francois
Hello, Sorry for posting basic question here, would you please let me know why such script does'nt work (error with "Premature end of script headers") ? #include using namespace std; int main() { cout << "Content-type: text/plain" << endl << endl << "Hello, World!"; } It actually shows flus