• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

c++ output html

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
usbertol
Asked:
usbertol
1 Solution
 
md041797Commented:
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now