Solved

c++ output html

Posted on 1997-06-10
1
229 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

733 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