Web Hosting Talk







View Full Version : how do you embed c++ in html?!


John0000
01-23-2005, 12:48 AM
I was wondering if it is possible to embed c++ into html as a form of serverside scripting. Please Help!

rapta
01-23-2005, 04:29 AM
not possible

Burhan
01-23-2005, 04:45 AM
Possible using CGI.

cow_helmet
01-23-2005, 07:20 AM
You can't "embed" C++ into HTML in the same way that you may be used to with your favorite scripting language. You can have compiled C++ applications eat your input and spit out your output, but you can't have


<html>
<head>
<title>LOL WELCOME TO MY AWESOME HOME PAGE</title>
</head>
<body>
<?c++
cout << c++info() << endl;
?>
</body>
</html>


If you could, then that would be pretty neat.

plumsauce
01-24-2005, 09:25 PM
Actually, you can.

Checkout ch from softintegration.com (http://softintegration.com) :stickout:

ch is a c++ interpreter

there is a free version and many modules posted for web services

your alternative is to use javascript as your server side scripting language which is possible in IIS.

I have no connection to the company, I just like c and downloaded as much as I could just yesterday.

cheers

nnormal
01-25-2005, 11:24 AM
personally I wouldnt do the cgi thing. C++ just isnt that great of a serverside language by itself. What I have done when we need the allout brute force power of C++ in a server script is to write a custom addition to the language we have in place. In our case we were using coldfusion and I implemented it as a custom tag. I am sure there is a similair approach with PHP although I havent used it.

webdesign jr
01-25-2005, 12:37 PM
I did this several times in two ways:
- classical CGI script
- using PHP and control the C++ code using one of the program execution functions (was it exec ??, do not remember)
and yes, nnormal is right, you can create a extension module for php

--------------------------------
http://www.scisoft.cz/webdesign-cz/webdesign.php

webdesign jr

John0000
01-25-2005, 04:50 PM
thanks guys