eval( " ?> $contents <?php " );
However, if eval() is the answer, you're probably asking the wrong
question. You should take a hard look at your code and think of a better
way to do what you need to do.
Back to the drawing board? It is either store my html+embedded code in a
mysql record, or in an html file, which means playing with fopen. It's
easier to hand tweak in phpmyadmin.
Nonetheless, even though your test code worked (thanks!) this doesn't. Sigh.
if ($contents = displaynew()) eval( " ?> $contents <?php " );
function displaynew()
{
$file = basename($_SERVER['PHP_SELF']);
require 'connect.inc';
$sql = "SELECT HTML FROM `$db`.`$table_editor` WHERE `Filename` LIKE
'".addslashes($file)."' LIMIT 1;";
if ($myquery = mysql_query($sql) and mysql_num_rows($myquery) > 0) {
$mydata = mysql_fetch_array($myquery, MYSQL_NUM);
return $mydata[0];
}
return false;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php