Okay let me try explaining all this again:
The database field has this in it:
HEADLINE
TEXT TEXT TEXT<?php
echo '<a href="printlegal.php?pageid=' . urlencode($_GET['pageid']) . '" class="bodynav">Printer Friendly Version</a>';
?>
This is the code that is supposed to output that field WITH the eval function:
<?php
if (isset($pageid) && is_numeric($pageid))
{
$display_legal = mysql_query("SELECT html FROM legal WHERE pageid=$pageid")
or die ("MySQL Error");
if (mysql_num_rows($display_legal) > 0)
{
while ($row = mysql_fetch_array($display_legal))
{
$legal = $row["html"];
eval (" ?> " . $legal . " <?php ");
echo ("<!-- startprint -->$legal<!-- stopprint -->");
}
}
}
else
{
echo("<P CLASS=\"bodytext\" ALIGN=\"CENTER\">OOX Error: \"The requested page does not exist.\"<BR>
Please <A HREF=\"javascript:history.go(-1);\" CLASS=\"bodynav\">click here</A>
to go back.</P>");
}
?>
You see echo ("<!--startprint -->$legal<!--stopprint -->"); <!-- startprint -->/<!-- stopprint --> is used by another page to know what to convert into a printer friendly format so ignore that.
What the page outputs is this:
HEADLINE
TEXT TEXT TEXT
Printer Friendly Version
HEADLINE
TEXT TEXT TEXT
Do you understand what is happeneing now?