in reply to Dynamic HTML via MySQL

This is a faq. How can I expand variables in text strings?

Think about using a more flexible templating system like Text::Template or HTML::Template or Template Toolkit.