I want to know if I can use C++ to allow for dynamic webpage creation, and stuff like that, similar to cgi and php scripts. I don't want to have to learn a new languge, if possible. And I do need to create interactive pages.
Thanks in advance
I want to know if I can use C++ to allow for dynamic webpage creation, and stuff like that, similar to cgi and php scripts. I don't want to have to learn a new languge, if possible. And I do need to create interactive pages.
Thanks in advance
I believe it is possible to write CGI with C++. I dont really know much about though.
of course. but what you're talking about is basically writing a preprocesser like PHP that understands HTML, right? seems like learning a new language would be a lot easier - not to mention most servers out there aren't going to run just any executable on their machines...
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
you could, but if your going for easy then learning php or cgi would be the easier way
If it is possible to write cgi scripts using C++, I would do that. I'm just wondering, is cgi compiled? Otherwise, since my site is not self-hosted, it would not be certain that the server would run the compiled code.
cgi is not a language, it's a protocol.
Your php or Perl interpreter is a cgi program.
cgi programs (strictly speaking libraries of course as they run inside something else) can be created using pretty much anything.
C is the most commonly used language, but C++, Delphi, Python, and others, can also be used.
http://www.boutell.com/cgic/
Library for making CGI scripts in C, which might be used in C++ (Haven't tried)
if you're going to be using CGI anyway, I'd suggest learning PERL instead of trying to do it with C/C++ - You'll find that you don't want a compiled binary for every little errand you want done quickly
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
But computers are so fast anyway, (I'm using a iMac G5) would compiling really be a problem?
...you don't seem to get it...
First, you can't create a "script" with a compiled language, so the real answer to your original question is: no.
Second, I mean what if you want to open a file, remove timestamps, and then close the file. IMO, it's faster to write the code, then type "perl killstamps.pl" then write the code, wait for it to compile, then run it. It also makes things cleaner, because now you just have a script lying around. With C/C++, you have both the source and a compiled binary. Get rid of the source and you can't rebuild the binary. Get rid of the binary and you have to recompile the source.
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
They aren't CGI programs, they're just interpreters for PHP and Perl. Well, PHP is usually used as an Apache module.Originally Posted by jwenting
CGI programs don't run inside anything else; they're just processes with stdin and stdout piped to certain places, with some environment variables set up certain ways.
This is a pretty good tutorial that explains low-level what's going on: http://www.cs.tut.fi/~jkorpela/forms/cgic.html
Last edited by Rashakil Fol; 03-16-2006 at 09:28 PM.
There are 10 types of people in this world, those who cringed when reading the beginning of this sentence and those who salivated to how superior they are for understanding something as simple as binary.