Solved

c++ output html

Posted on 1997-06-10
1
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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…

724 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