views:

339

answers:

1

Hello All,

Using the wysiwyg CKEditor I stored the following into MySql:

 <p>
Here is the information that we would like to have show</p>
<p>
&nbsp;</p>
<p>
Project:<?php echo $project; ?></p>

I need to echo this content as $content and have the $project variable populate from _POST data.

When I do this however the result looks like this:

Here is the information that we would like to have show

Project:

In the source for the page you can see the echo statement but nothing appears inspite of knowing that the $project variable is set and has a value.

Someone mentioned a str_replace statement and write the variable as %project% but how does it change from %project% to <?php echo $project; ?>

Thanks for reading.

Tom

+1  A: 

to execute php that is saved inside a string you can use eval()

i also like the %project% approach more. i think this is how it would work:

echo str_replace('%project%', $project, $sql_content);
antpaw