473,406 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

C++ for web development?

I was wondering if there was any web server which supported the use of
c++ as a server side method for creating dynamic web pages. Is this
viable, or should I just bite the bullet and learn a server-side
scripting language like php?

-- Thanks in advance
Jul 22 '05 #1
9 1779
On Thu, 19 Aug 2004 05:22:52 GMT, Robert <gr*****@REMOVEhotmail.com> wrote:
I was wondering if there was any web server which supported the use of
c++ as a server side method for creating dynamic web pages. Is this
viable, or should I just bite the bullet and learn a server-side
scripting language like php?


Almost all of them do.

You can write a CGI program in almost any language. Which of course
means it has nothing to do with the C++ language and hence is off
topic, try:

comp.infosystems.www.cgi
--
Sam Holden
Jul 22 '05 #2
"Robert" <gr*****@REMOVEhotmail.com> wrote in message
news:MO****************@bignews1.bellsouth.net...
I was wondering if there was any web server which supported the use of
c++ as a server side method for creating dynamic web pages. Is this
viable, or should I just bite the bullet and learn a server-side
scripting language like php?


I'm sure that it is possible to write C++ CGI applications. I have seen C++
CGI code, and there are libraries to aid in C++ CGI development (e.g.
http://www.gnu.org/software/cgicc/cgicc.html). However, this is not a topic
generally discussed in comp.lang.c++. I will say that higher-level
languages like Java, Perl, Python, and PHP will probably provide more
extensive web development libraries and a larger web development community
due to their popularity amongst web developers.

--
David Hilsee
Jul 22 '05 #3
Robert wrote:
I was wondering if there was any web server which supported the use of
c++ as a server side method for creating dynamic web pages. Is this
viable, or should I just bite the bullet and learn a server-side
scripting language like php?


-- Thanks in advance

In the MS world you can do it with "ATL server" of IIS in this style:
You create a class with methods and you assign each method a keyword
called tag.
Then in a SRF file (which is the ATL Server dynamic file) you write HTML
and inside it you use those keywords, which are replaced with outputs of
method calls when the page is called through a browser.
An example. The C++ file:
#include <ctime>

class whatever
{
// ...
public:

[tag_name(name="GetDate")]
HTTP_CODE OnGetDate()
{
using namespace std;

time_t theTime;
time(&theTime);

m_HttpResponse<<ctime(&theTime);

return HTTP_SUCCESS;
}

// ...
};

The SRF file:
<html>
<HEAD>
</HEAD>

<BODY>
{{handler whatever.dll/Default}}

<h2>Time Server</h2>
The current date and time is: {{GetDate}}

</BODY>
</html>
The {{GetDate}} above is replaced with the output passed to
m_HttpResponse object.


Regards,

Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 22 '05 #4
"Robert" <gr*****@REMOVEhotmail.com> wrote in message
news:MO****************@bignews1.bellsouth.net...
I was wondering if there was any web server which supported the use of
c++ as a server side method for creating dynamic web pages. Is this
viable, or should I just bite the bullet and learn a server-side
scripting language like php?


I would strongly suggest giving PHP a shot - you'll see its easy to
set-up, well supported, and takes little work to fulfill basic needs.
Of course web applications can be written in C++,
but it would be very much like hammering a screw.

--
http://ivan.vecerina.com/contact/?subject=NG_POST <- e-mail contact form
Jul 22 '05 #5
Ivan Vecerina wrote:

"Robert" <gr*****@REMOVEhotmail.com> wrote in message
news:MO****************@bignews1.bellsouth.net...
I was wondering if there was any web server which supported the use of
c++ as a server side method for creating dynamic web pages. Is this
viable, or should I just bite the bullet and learn a server-side
scripting language like php?


I would strongly suggest giving PHP a shot - you'll see its easy to
set-up, well supported, and takes little work to fulfill basic needs.
Of course web applications can be written in C++,
but it would be very much like hammering a screw.

That all depends. PHP is great and I use it for web developement, but it
can be very slow if you have some intensive work for it to do, like
search a bunch of files. Something that compiles to machine code, like C
or C++ can be very useful in the right application. It's worthwhile
knowing how to do both.

In answer to the OP's question, CGI only requires that programs be able
to access environment variables, read from standard in and write to
standard out. C++ can do all of these. As others mentioned, there are
prefab libraries out there to help out. Search for: C++ cgi

Brian Rodenborn
Jul 22 '05 #6
Robert <gr*****@removehotmail.com> spoke thus:
I was wondering if there was any web server which supported the use of
c++ as a server side method for creating dynamic web pages. Is this
viable, or should I just bite the bullet and learn a server-side
scripting language like php?


<ot>It's certainly possible - all my company's dynamic web pages are
handled by CGI's written in C++. Now whether that's preferable to a
scripting language is another question altogether - my impression is
that it isn't.</ot>

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 22 '05 #7
> In the MS world you can do it with "ATL server" of IIS in this style: You
create a class with methods and you assign each method a keyword called
tag.


Don't forget also, that you can do traditional asp.net programming using
managed c++ as the code behind. I would imagine this will be the case with
the upcomming c++/cli, and will be even better since you can utilize much
more natural c++ syntax.

- Don Kim
Jul 22 '05 #8
Robert wrote:
I was wondering if there was any web server which supported the use of
c++ as a server side method for creating dynamic web pages. Is this
viable, or should I just bite the bullet and learn a server-side
scripting language like php?

-- Thanks in advance


If you intend to do C++ CGI in scripting language, C++ interpreter
Ch has C++ CGI toolkit which provides ASP or JSP like APIs for
CGI programming. You can download it for free use at
http://www.softintegration.com/products/toolkit/cgi/

You can stil use your favorite C++ language to write web applications.

As for dynamic web page programming like PhP, the solution is still not
there. But I heard that in the future, there might be a module called
mod_ch for Apache that allows you to write server-side scirpting in C++.

Jul 22 '05 #9
Thank you for your suggestions everyone, and I'd like to apologize for
the off-topic nature of my post. I didn't realize.
Jul 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: VB | last post by:
iTechArt Group - Custom Software Development and Offshore outsourcing Company http://www.itechart.com/ Offshore custom software development company iTechArt - Web site and Content Management...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.