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 stackoverflow.com/questions/355650/…Michael Anderson– Michael Anderson2011年05月06日 00:25:01 +00:00Commented May 6, 2011 at 0: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– hornetbzz2011年05月06日 00:30:35 +00:00Commented May 6, 2011 at 0:30
1 Answer 1
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.