1

I'm really new to this. I am trying to write a CGI program that will take a pseudo-html file, find certain tags, and replace them with something else.

For example, if there is an html file, that has a "<list>" tag (which I believe is not an html tag), it would replace that tag with a list that it generates.

Is there an easy way of going about this? Or do I essentially need to do it from scratch?

I'm thinking about using the CGI++ library, does it have such a functionality?

Thanks

  • Duplicate of http://stackoverflow.com/questions/355650/c-html-template-framework-templatizing-library-html-generator-library – Michael Anderson May 06 '11 at 00:25
  • It depends a bit on your situation but I can't see the C++ interest in this case. PHP can do that quite well, or if you wish, you can also use a perl or python cgi file but this implies to add some more set up on your server. So to me, php is the simple way. – hornetbzz May 06 '11 at 00:30

1 Answers1

0

What you're asking for is generally called a templating engine - read the almost-HTML with special tags in it, interpret the tags. Frameworks like PHP were invented specifically for this kind of thing. Ditch C++, use PHP.

Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281
  • Thanks for the answer. I ended up using this: http://nulidex.com/code/docs/html_template/#DOWNLOAD. Pretty much exactly what I needed, and thank God, I didn't need to ditch C++. –  May 06 '11 at 15:31