Here is the code I need help with:
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"];
if ($pageid == 1)
{
echo $legal;
}
else {
echo ("<!-- startprint -->");
eval (" ?> " . $legal . " <?php ");
echo ("<!-- stopprint -->");
echo '<a href="printlegal.php?pageid=' . urlencode($_GET['pageid']) . '" class="bodynav">Printer Friendly Version</a>';
}
}
}
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>");
}
What I am trying to do is that if the pageid in the URL is 1, only display whatever is in the database field, any other page id will use the things in the else function. When I test this page in my browser, I only see whatever is in the database field, I don't see the "Printer Friendly Version" link at all... Where did I mess up?