C++ and The Web

Started by
4 comments, last by bdc256 21 years, 5 months ago
Can Some one please give me a simple example of how to link a C++ program to the web. As a CGI program, or any other way you know how. I would like it to retive a small amount of data, but a counter program would be good to.
Advertisement
you need a web host that allows you to run CGI-BIN scripts/programs. until you have that you can''t do anything.

you should also look into PHP or Jsp/Java. those also require special permissions / setups on the webserver, but are a better way to go about introducing computer code-type logic into webpages

-me
Probably, u should read little about dynamic/cgi programming. Try PHP first, to get sense of web programming. Then migrate to C/C++. There are several libraries that could help u in data manipulation:

http://www.eekim.com/software/cgihtml/cgihtml.html
http://libcgi.sourceforge.net/

Lekha
you could run your own apache server to try things out on your local machine.
cgi programs are fairly simple

If memory serves, they''re basically the equivalent of console programs (although I don''t remember if querystring/form data is passed on stdin or argv[])

But to write the HTML output, just cout or printf() it.
daerid@gmail.com
quote:Original post by daerid
(although I don''t remember if querystring/form data is passed on stdin or argv[])

I think GET (querystring) is generally passed as the argv[] and POST (form data) is usually passed as stdin.


[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

This topic is closed to new replies.

Advertisement