Categories > TinyButStrong general >

html tags in php variable

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: euchre
Date: 2008-10-30
Time: 10:34

html tags in php variable

In my php file, I store html formatted content like this...

    if (mysql_num_rows($callproverbs) < 1) {
        // if table has no records then inform user
        $displayproverb = "<p><i>Sorry, no stats to show.</i></p>";
            } else {
                $displayproverb = "<table border=\"1\"><tr><td align=\"left\">Proverb</td><td align=\"right\">Author</td></tr><table>";
            }

When it is outputted in the html file as [var.displayproverb], I get all the p, i tags and td align=\"right\"  displayed instead of having the proverb in the table.

I don't see any similar in the example.  Is there a way to make it parse the html tags within the variable when it is outputted?
By: TomH
Date: 2008-10-30
Time: 13:35

Re: html tags in php variable

Personally I would take advantage of the fact that TBS is a  template engine and move the HTML into your template file ;) and use conditional example to see how to show/not show the different output.

Otherwise the htmlconv parameter (see Manual) might fix the problem.