Connecting Tech Pros Worldwide Forums | Help | Site Map

using c++ with web development languages

vfunc@talktalk.net
Guest
 
Posts: n/a
#1: May 20 '06
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.


benben
Guest
 
Posts: n/a
#2: May 20 '06

re: using c++ with web development languages


vfunc@talktalk.net wrote:[color=blue]
> 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.
>[/color]

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
noone
Guest
 
Posts: n/a
#3: May 20 '06

re: using c++ with web development languages


On Sat, 20 May 2006 08:29:37 -0700, vfunc@talktalk.net wrote:
[color=blue]
> 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.[/color]

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.


Phlip
Guest
 
Posts: n/a
#4: May 20 '06

re: using c++ with web development languages


vfunc wrote:
[color=blue]
> What do people do along the lines of generating html, php or some other
> scripts for web dev?[/color]

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.
[color=blue]
> Also what is the usual way of linking C++ with
> these web languages ? I'm more interested in Linux than windows
> platform.[/color]

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?

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!


vfunc@talktalk.net
Guest
 
Posts: n/a
#5: May 20 '06

re: using c++ with web development languages


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

Phlip
Guest
 
Posts: n/a
#6: May 20 '06

re: using c++ with web development languages


vfunc wrote:
[color=blue]
> yes "linking c++ with web languages" to "generate web content" or as a
> way to provide a basic interface to a c++ program.[/color]

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.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!


vfunc@talktalk.net
Guest
 
Posts: n/a
#7: May 23 '06

re: using c++ with web development languages


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.

Victor Bazarov
Guest
 
Posts: n/a
#8: May 23 '06

re: using c++ with web development languages


vfunc@talktalk.net wrote:[color=blue]
> XSLT and XHTML is interesting (although I'm not familliar with it) and
> this method[/color]

Which method?
[color=blue]
> 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.[/color]

Aha... OK.

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


vfunc@talktalk.net
Guest
 
Posts: n/a
#9: May 23 '06

re: using c++ with web development languages


"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.

Victor Bazarov
Guest
 
Posts: n/a
#10: May 23 '06

re: using c++ with web development languages


vfunc@talktalk.net wrote:[color=blue]
> [..]
> I clicked reply. My browser does not quote the messsage.[/color]

Perhaps you should get a better browser or click something different..


Marcus Kwok
Guest
 
Posts: n/a
#11: May 23 '06

re: using c++ with web development languages


vfunc@talktalk.net <vfunc@talktalk.net> wrote:[color=blue]
> I clicked reply. My browser does not quote the messsage.[/color]

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

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
frankgerlach@gmail.com
Guest
 
Posts: n/a
#12: May 24 '06

re: using c++ with web development languages


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 ?

frankgerlach@gmail.com
Guest
 
Posts: n/a
#13: May 24 '06

re: using c++ with web development languages


I got the Content-Type wrong; should be "text/html; charset=iso-8859-1"

Phlip
Guest
 
Posts: n/a
#14: May 24 '06

re: using c++ with web development languages


frankgerlach wrote:
[color=blue]
> C++ can be perfectly used to create a simple http server. Just...[/color]

....download the latest version of Eddie's Wiki:

http://www.wikiserver.org/download.html

Then convert it to C-style C++ and keep going!

(BTW wheel-reinvention is also a Bad Thing.)

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!


frankgerlach@gmail.com
Guest
 
Posts: n/a
#15: May 24 '06

re: using c++ with web development languages


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

vfunc@talktalk.net
Guest
 
Posts: n/a
#16: May 26 '06

re: using c++ with web development languages



Victor Bazarov wrote:[color=blue]
> vfunc@talktalk.net wrote:[color=green]
> > [..]
> > I clicked reply. My browser does not quote the messsage.[/color]
>
> Perhaps you should get a better browser or click something different..[/color]

lol, like that, or get a browser with speech recognition...

vfunc@talktalk.net
Guest
 
Posts: n/a
#17: May 26 '06

re: using c++ with web development languages



Marcus Kwok wrote:[color=blue]
> vfunc@talktalk.net <vfunc@talktalk.net> wrote:[color=green]
> > I clicked reply. My browser does not quote the messsage.[/color]
>
> If you are using Google Groups, please read
> http://cfaj.freeshell.org/google/
>
> --
> Marcus Kwok
> Replace 'invalid' with 'net' to reply[/color]

frankgerlach@gmail.com wrote:[color=blue]
> If that wheel is ten times lighter than the "existing wheel" (Apache,
> wikiserver) then it is worth to reinvent it ![/color]

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++.

Closed Thread


Similar C / C++ bytes