using c++ with web development languages

V

vfunc

What do people do along the lines of generating html, php or some other
scripts for web dev? Also what is the usual way of linking C++ with
these web languages ? I'm more interested in Linux than windows
platform.
 
B

benben

What do people do along the lines of generating html, php or some other
scripts for web dev? Also what is the usual way of linking C++ with
these web languages ? I'm more interested in Linux than windows
platform.

Language wise you should expect to have some sort of proxy interfaces to
dispatch inter-language invocations. Otherwise you should expect other
non-C++ modules compiled to a binary interface compatible to that from
C++ so you can link them.

In any situation you have to RTM specific to the platform that you
program against.

Regards,
Ben
 
N

noone

What do people do along the lines of generating html, php or some other
scripts for web dev? Also what is the usual way of linking C++ with these
web languages ? I'm more interested in Linux than windows platform.

your question is too vague for me to answer. can you be more specific of
what it is you are trying to do?

are you asking about dynamically generated pages as opposed to static ones?

what do you mean "linking c++ with web languages"? why?

c++ can be used to generate web content as a server side tool like cgi but
there are much better tools for generating web content: perl (my
favorite), php, etc.

remember that the web browser only knows html, javascript, and maybe java
applets. anything sent to the browser must follow those conventions.
what you do on the server side is more dependent upon what the web server
daemon configuration allows.
 
P

Phlip

vfunc said:
What do people do along the lines of generating html, php or some other
scripts for web dev?

To write a web site in C++, get tinyxml and an XSLT processor, such as
MSXSL.exe or xsltproc. Write a web page's variable data into an XML file,
and write an XSLT template which converts this into XHTML. So a CGI script
written in C++ can simply parse out the server variables with cgicc. Then it
performs its logic, writes an XML file, translates this with XSLT, and
streams the translation out the web server.
Also what is the usual way of linking C++ with
these web languages ? I'm more interested in Linux than windows
platform.

Just write in C++. Folks use soft (and advertised) languages for web
development under the mistaken belief they enable rapid application
development. C++ is just as rapid if you follow a few zillion rules, such as
rely on the Standard Library, and write unit tests.

You were going to write unit tests in your soft language too, right?
 
V

vfunc

yes "linking c++ with web languages" to "generate web content" or as a
way to provide a basic interface to a c++ program.
 
P

Phlip

vfunc said:
yes "linking c++ with web languages" to "generate web content" or as a
way to provide a basic interface to a c++ program.

On Google Groups, please use Reply -> Preview -> Edit to supply the
replied-to text. Then trim the text down to the minimum that cites its
author and provides context.

Next, most languages have a system to bind with C++. Maybe they can reach
into a standard interface in a dynamic link language, and maybe they can
reach into an ORB like COM or CORBA.

All these things are only on-topic on their forums. You must pick a language
to do web development (and like I said C++ will work fine), and then you
must ask this question on a forum that discusses the resulting platform.
This forum is only qualified to discuss platform-neutral C++ things.
 
V

vfunc

XSLT and XHTML is interesting (although I'm not familliar with it) and
this method sounds good for generation of dynamic content (dificult for
me as I'm barely a beginer in XML, PHP, java etc).
Actually I am more interested in taking a data dictionary like an SQL
create database script and writing a C++ program to convert that to an
web interface, including some specifics (validation or display tweaks)
from yet another file.
 
V

Victor Bazarov

XSLT and XHTML is interesting (although I'm not familliar with it) and
this method

Which method?
sounds good for generation of dynamic content (dificult
for me as I'm barely a beginer in XML, PHP, java etc).
Actually I am more interested in taking a data dictionary like an SQL
create database script and writing a C++ program to convert that to an
web interface, including some specifics (validation or display tweaks)
from yet another file.

Aha... OK.

Next time, perhaps you could quote the message you're respoding to.
 
V

vfunc

"To write a web site in C++, get tinyxml and an XSLT processor, such as

MSXSL.exe or xsltproc. Write a web page's variable data into an XML
file,
and write an XSLT template which converts this into XHTML. So a CGI
script
written in C++ can simply parse out the server variables with cgicc.
Then it
performs its logic, writes an XML file, translates this with XSLT, and
streams the translation out the web server."

That method. It was the previous message to the one I mentioned.

"Next time, perhaps you could quote the message you're respoding to. "

I clicked reply. My browser does not quote the messsage.
 
F

frankgerlach

C++ can be perfectly used to create a simple http server. Just create a
server socket, which has an accept() loop. Whenever you get a client
connection, create a thread using pthread-create() and start the
handler function. In the handler function, you have to interpret
somthing like the following:
"GET /get_account_balance.cpppage?AccountID=47&Password=secret
HTTP/1.1\r\n"
"\r\n"
and respond with something like the following:
"HTTP/1.1 200 OK\r\n"
"Content-Length: 53\r\n"
"Connection: close\r\n"
"Content-Type: text/plain; charset=iso-8859-1\r\n\r\n"
"<html><body>Your Account Balance is 40$</body></html>"

I am not sure this is 100% http compliant, but it is simple and it
works. Why use all the a big full-blown web server if you can do the
http protocol and thread creation on your own ?
 
F

frankgerlach

If that wheel is ten times lighter than the "existing wheel" (Apache,
wikiserver) then it is worth to reinvent it !
 
V

vfunc

Marcus said:
If you are using Google Groups, please read
http://cfaj.freeshell.org/google/

If that wheel is ten times lighter than the "existing wheel" (Apache,
wikiserver) then it is worth to reinvent it !

I'm refering to preproduction of pages using C++ rather than run time
variations e.g. generating SQL, loops for lists and tables.. either
output to PHP, Java, some XML format or something else or yes why not
C++.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top