Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

c++ output html

Posted on 1997-06-10
1
Medium Priority
?
242 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 300 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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…
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.
Suggested Courses

618 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