When I was searchin for a webhost I saw that some of them offered php. But I also noticed some offered c++.
What does that mean? Can I use c+
+ on my websites on that host or what?
Printable View
When I was searchin for a webhost I saw that some of them offered php. But I also noticed some offered c++.
What does that mean? Can I use c+
+ on my websites on that host or what?
CGI - Common Gateway Interface.
When you fill in a form on web page, it is often processed by this means. The HTML will specify variable names to hold the data in each element, default values, etc... and a method of sending it to the webserver (POST or GET - the difference as far as a CGI script is concerned is just the means by which it reads in the data). The webserver will pass all this on to your CGI script which will then execute. You can then process these variables (you may have to extract them from a long string - the format is something like "name1=value1&name2=value2" but I can't remember for sure), and then you can send back the webpage, by outputting HTML code to stdout (cout does this). This allows you to create webpages on the fly - "Dynamic Content". Do a search on google and you'll get a more conprehensive tutorial on using C++ for CGI scripts. It's a lot of fun - I think you'd enjoy it.
You can also use PHP's passthru() function to execute a program and have its output echo'd to the webpage.
This is very very useful sometimes.
well not what I hoped for. But maybe I will check in on it. I still need a better c++ compile to do ragular c++ programs.
What compiler do you have?
I use dev-cpp
GCC/MinGW (the compiler in Dev-C++) is a great compiler for working with C++ (at all levels: beginner to commercial software).
someimtes, I think some of there .h files are outdated tho.
:confused: Well, you can always add libraries (or update ones). What in particular makes you think that, though?