Your Ad Here

Wednesday, March 11, 2009

php in the content of a string

Quickie (I hope):

I have a line of PHP code that should only be written to an HTML file under certain conditions, and it pulls a variable from another piece of PHP:


Code:
---------
$scriptquery = "SELECT * FROM scripts";

$scriptresult = mysql_query($scriptquery);

while ($scriptrow = mysql_fetch_array($scriptresult)) {

$replaceme="ooo!".$scriptrow['name']."!ooo";

$replacescriptinclude="content); ?>";

$txtContent=str_replace($replaceme,$replacescriptinclude,$txtContent);
}
---------
Yet the money line, $replacescriptinclude, invariably writes this:


Code:
---------

---------
Any ideas why?
Your Ad Here

No comments: