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

asked May 5, 2011 at 22:07
2
  • Duplicate of stackoverflow.com/questions/355650/… Commented 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. Commented May 6, 2011 at 0:30

1 Answer 1

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.

answered May 5, 2011 at 22:37
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the answer. I ended up using this: nulidex.com/code/docs/html_template/#DOWNLOAD. Pretty much exactly what I needed, and thank God, I didn't need to ditch C++.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.