Solved

c++ output html

Posted on 1997-06-10
1
204 Views
Last Modified: 2010-08-05
hi ,
  Am working on a solo project for a program in c++ that,called from an html
   page output  another html document..so far so good.
   My problem is that I havent figure out, once my html file is created,
   how to get the browser to go to that page.
   Should it be the job of the c++ code or the posting method in the "calling
   "html document to direct the browser to that page?
   Does anyone have any example I could study?
   Any input would be appreciated
   Sergio
>   usbertol@neiu.edu
0
Comment
Question by:usbertol
1 Comment
 
LVL 4

Accepted Solution

by:
md041797 earned 100 total points
ID: 1163875
You send your output as follows:
cout << "Content-type: text/html\n\n";
cout << "<html><head><title>Title</title><background="#000000";
cout << "text="#FF0000" ></head><body>text</body></html>"
cout << "\n\n"

or, if your page is in a text file, read it in and send it to cout;  This is the CGI C routine I'm talking about here.

Or, you can send a redirect:
cout << "Location: http://www.site.com/page.html\n\n";

I have more examples although they are oriented around perl, they still apply.  Let me know and I will email it to you.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now