I am retreiving a piece of HTML code that contains server-side code from a database and then using the echo command to write it to a web page. Everything works fine except the server-side code that is embedded in the code chunk does not get executed. It is just sitting there visible when you view the pages source.
How do I get this server-side code to be executed when it's echo'd to the page
Sample:
$var = $database->GetCodeChunk();
$var now equals this:
<table>
<tr>
<select id="myid">
<?
//do database stuff here
?>
</select>
</tr>
</table>
Now, I do this in my main page
//html code here
<table>
<?
echo $var
?>
</table>
// more html code
When viewing the page source, this is what I see
//html code here
<table>
<table>
<tr>
<select id="myid">
<?
//do database stuff here
?>
</select>
</tr>
</table>
</table>
// more html code
Now, what I want is for the server-side code in this page to be executed properly just like I had hard-coded it
Any ideas?