473,783 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML

Is it possible to use C or C++ to create web pages?

Ouputting text with HTML syntax is easy enough,
but how do I make a web browser see the generated
text?

Jul 19 '05 #1
6 2986

"Peter Morris" <no********@se. com> wrote in message
news:be******** **@sparta.btint ernet.com...
Is it possible to use C or C++ to create web pages?

Ouputting text with HTML syntax is easy enough,
but how do I make a web browser see the generated
text?


Sorry about the os-dependent reply, but this question is kind of
os-dependent (OP, please, next time, try to place this in a better
newsgroup). Just because I'm feeling nice:

(Assuming windows)

#include <fstream>
#include <stdlib.h>

int main()
{
using namespace std;

/* Output to text file the HTML stuff here */

system("iexplor e <filename>");
}

Obviously, replace <filename> with whatever file you sent it to. This should
open up internet explorer to view the newly created file. Note that you need
to output this code to a file with a .htm or .html extention!

--
MiniDisC_2k2
To reply, replacenospam.c om with cox dot net.
Jul 19 '05 #2

"Peter Morris" <no********@se. com> wrote in message
news:be******** **@sparta.btint ernet.com...
Is it possible to use C or C++ to create web pages?

Ouputting text with HTML syntax is easy enough,
but how do I make a web browser see the generated
text?


Just output it in the file and then start browser and tell it to read this
file.

Michael Furman

Jul 19 '05 #3

"Michael Furman" <Mi***********@ Yahoo.com> wrote in message
news:be******** ****@ID-122417.news.uni-berlin.de...

"Peter Morris" <no********@se. com> wrote in message
news:be******** **@sparta.btint ernet.com...
Is it possible to use C or C++ to create web pages?

Ouputting text with HTML syntax is easy enough,
but how do I make a web browser see the generated
text?


Just output it in the file and then start browser and tell it to read this
file.

Michael Furman


If that's all I wanted, I could just write the HTML file myself.

In Perl, for instance, I can write a script that outputs HTML.
If I run the script, it outputs the text to the screen. But I
can point Internet Explorer at the script, and it displays
a web page. This is dynamically generated, it varies according
to data read from a database.

I've written an application in perl, but I want to port it to
C++ or similar, using a complied executable instead of a
Perl script.

Jul 19 '05 #4
"Peter Morris" <no********@se. com> wrote in message
news:be******** **@titan.btinte rnet.com...

"Michael Furman" <Mi***********@ Yahoo.com> wrote in message
news:be******** ****@ID-122417.news.uni-berlin.de...

"Peter Morris" <no********@se. com> wrote in message
news:be******** **@sparta.btint ernet.com...
Is it possible to use C or C++ to create web pages?

Ouputting text with HTML syntax is easy enough,
but how do I make a web browser see the generated
text?
Just output it in the file and then start browser and tell it to read
this file.


If that's all I wanted, I could just write the HTML file myself.

In Perl, for instance, I can write a script that outputs HTML.
If I run the script, it outputs the text to the screen. But I
can point Internet Explorer at the script, and it displays
a web page. This is dynamically generated, it varies according
to data read from a database.


I don't know how you've configured things, but that doesn't work for me
unless I access the Perl script through a web server. Is that what you're
getting at? You want your web server to run a C++ program and serve the
output to a web browser? If so, then it's just an issue of configuring your
web server. But that's off-topic here.
I've written an application in perl, but I want to port it to
C++ or similar, using a complied executable instead of a
Perl script.


FYI, if you're processing GET/POST requests, you might find this C++ CGI
library helpful:

http://www.cgicc.org/

You'll probably want to use some other non-standard library for accessing
your database.

In any case, it sounds like another newsgroup would be more helpful to you.
comp.infosystem s.www.authoring.cgi, maybe.

--
Russell Hanneken
rh*******@pobox .com
Jul 19 '05 #5

On Thu, 10 Jul 2003, Peter Morris wrote:
"Peter Morris" <no********@se. com> wrote in message
Is it possible to use C or C++ to create web pages?

If that's all I wanted, I could just write the HTML file myself.

In Perl, for instance, I can write a script that outputs HTML.
If I run the script


via a CGI-BIN server or similar, I presume?
it outputs the text to the screen. But I
can point Internet Explorer at the script, and it displays
a web page. This is dynamically generated, it varies according
to data read from a database.
Depends on what support your host has for CGI. Geocities, for example,
doesn't have any. Point IE at a Perl script hosted there, and you
get a screenful of line noise. (Perl source, that is.) The same thing
happens if I point IE at a Perl script on my hard disk, although if
you have it configured differently, I've no doubt you could get a "CGI
server" on your own machine. I'd kind of like that. :)
I've written an application in perl, but I want to port it to
C++ or similar, using a complied executable instead of a
Perl script.


Look up the Perl equivalent of 'system()'. Then compile your C++
program to an executable (for whatever OS is running on your host
machine), and exec that program via a Perl script. Completely
untested and OT stuff follows:

% cat hello.cc

#include <iostream>
int main()
{ std::cout << "Hello world!" << std::endl; return 0; }

% cat hello.cgi
#!/usr/bin/perl

print "Content-type: text/html\n\n";
print `./hello`; ## Note the backquotes!

% g++ -o hello hello.cc
% chmod 755 hello.cgi

HTH,
-Arthur

Jul 19 '05 #6


Peter Morris wrote:
Is it possible to use C or C++ to create web pages?
of course, there is a cross platform C++ CGI toolkit
runs in C/C++ interpreter Ch.

http://www.softintegration.com/products/toolkit/cgi/

To access database, you write ODBC code which can
be used for any database in any OS.

ODBC information can be found in Microsoft MSDN, or
http://www.softintegration.com/products/toolkit/odbc/


Ouputting text with HTML syntax is easy enough,
but how do I make a web browser see the generated
text?


Jul 19 '05 #7

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

Similar topics

4
8406
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties in JavaScript/JScript and HTML/XML elements. Without trying to get famous :-) but thinking it would be interesting to others I decided to post the following summary: 1. Variable names in JavaScript/JScript
4
2974
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text email by creating a text file, with content following certain format, and saving that file into the correct '..\mailroot\pickup' folder, and it is working fine
1
2423
by: cirillo_curiosone | last post by:
Hi, i'm new to javascript. I started studing it on the web few weeks ago, but still haven't been able to solve one big problem: HOT TO PASS VALUES FROM A SCRIPT VARIABLE TO A CHILD HTML GENERATED BY FUNCTION. Here'e the point: I'm writing a simple website for showing my photographs. It has a central page with many links (as many as galleries are).
33
4783
by: LRW | last post by:
http://gto.ie-studios.net/index.php When you view the above site in IE, if the 1st of the three product images is tall enough to push the cell down a couple of pixels, IE somehow doesn't show that happening. But if you look at it in Firefox you can see the small gap of white where the semi-circle image is broken. I've tried changing the background colors to gray in cells and tables
0
395
by: Boris Ammerlaan | last post by:
This notice is posted about every week. I'll endeavor to use the same subject line so that those of you who have seen it can kill-file the subject; additionally, Supersedes: headers are used to ensure that only one copy resides on a given news server. This notice was last updated on March 9th, 2005, and is available (with a complete revision history) on the World Wide Web at http://www.stack.nl/~boris/HTML/ciwahfaq.html. Most of it was...
9
2007
by: Patient Guy | last post by:
Taking the BODY element as an example, all of its style attributes ('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01, a fact noted in the DOM Level 2 HTML specification. The DOM specification does not explicitly itself deprecate the use of attributes however for the element in the interface definition section I read. Is there text in the DOM specification that states specifically that the DOM specification...
5
3596
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact that for server control component , code is running on the server side. But if I take as example a Label. I place on a webform an HTM label control and a WebForm label control, I could see that properties are different for
6
433
by: Guy Macon | last post by:
cwdjrxyz wrote: HTML 5 has solved the above probem. See the following web page: HTML 5, one vocabulary, two serializations http://www.w3.org/QA/2008/01/html5-is-html-and-xml.html
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7494
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.