Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie needs help generating html files from user input via win gui

Status
Not open for further replies.

dstrain

Technical User
Mar 29, 2006
9
US
Hello. I'm a absolute beginner at programming, but have a final class project that I'd like to begin working on nice and early. What I'd like to build is a Visual C++ program that will:

1. Take user input from a windows gui (text boxes, drop down menus, etc.)
2. Insert the input into the appropriate locations in existing html templates
3. Create new html pages based on the templates, but that has the users input added
4. Save the page(s) within a folder named something the user chooses, and have this folder located in a "projects" or "websites" directory where they can then quikcly access the folders/files and upload them to their server.

During this process the existing templates should not be overwritten either.

I've been able to create a very basic html page from console input using and "getline", but it requires mixing all the html tags with the c++ in the .cpp file. It's just messy and cumbersome. I know there must be a more efficient and elegant way of doing this that keeps the html separate from the c++, but at my beginner level I just don't know where to start. Hopefully someone here will have some insight and can give me some tips.

Thanks in advance.
 
If your HTML template looks something like this:
Code:
<HTML>
<HEAD><TITLE><!-- Template field 1 --></TITLE></HEAD>
<BODY>
<H1>Hello <!-- Template field 2 -->.  Welcome back!</H1>
</BODY>
</HTML>
Then, read the whole template into a string, search for the "<!-- Template field 1 -->" and replace it with the first field the user enters, then do the same with all the other "<!-- Template field# -->" substrings.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top