php not activated
| From: | John Taylor-Johnston | Date: | Sun, 30 Oct 2005 14:13:05 +0000 |
| Subject: | php not activated | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-224843@lists.php.net to get a copy of this message | ||
I have some html + php stored in a mysql record. But when I echo the contents:
$mydata->HTML="<input type="text" size="40" value="<?php
if($searchenquiry)
echo stripslashes(htmlspecialchars($searchenquiry));
?>" name="searchenquiry" />";
the php is not activated; rather I see <?php ... ?> in my html source. It worked before, I thought.
P.S. is there a better way to use this function?
John
--------snip---------
display();
echo $contents;
function display()
{
global $contents, $PHP_SELF;
$file = basename($PHP_SELF);
include("connect.inc");
$sql = "SELECT * FROM
".$db.".".$table_editor." WHERE Filename LIKE '".$file."' LIMIT 0,1;";
$myquery = mysql_query($sql);
while ($mydata = mysql_fetch_object($myquery)) {
$contents = $mydata->HTML;
}
}