Forum Moderators: coopster
Code:
if (!$news_id)
{ // print the list if a record has not been selected
?>
<IFRAME width="100%" src="news_de_data.php" height="50%" frameborder="text/plain" marginheight="0" marginwidth="0">
</IFRAME>
<?PHP
}//main file area
-------------------------------
//from news_de_data.php
<?PHP
$db = mysql_connect("x.x.x.x", "x");
mysql_select_db("x",$db);
$result = mysql_query("SELECT * FROM news_de");
printf( "<TABLE border=\"1\"> <TR> <TH colspan=\"3\" align=\"center\">Data</TH></TR>");
echo "<tr><th align=\"left\" width=\"30%\">News_ID</th><th align=\"left\" width=\"30%\">Date of posting</th><th align=\"left\" width=\"40%\">Details</th> <tr>";
while ($myrow = mysql_fetch_array($result))
{
printf("<tr align=\"left\"><td><a href=\"%s? news_id=%s\">%s</a> </td><td>%s </td><td nowrap>%s ", $_SERVER['PHP_SELF'], $myrow["news_ID"], $myrow["news_ID"],$myrow["date"], substr($myrow["details"],0,49));
printf("<a href=\"%s?news_id=%s&delete=yes\">(DELETE)</a></td>", $_SERVER['PHP_SELF'], $myrow["news_ID"]);
}
echo "</table>";
?>
If more code is needed I'll be happy to post it. Thanks!
hm, if it worked until you pur it in the iframe I wonder if it is the $_SERVER['PHP_SELF'] messing up the hrefs. Maybe try putting the path to the file inthere specifically.
I would also compare what the output looks like by viewing source when it is in the iframe and when it isn't the PHP_SELF looks like the only part that would be different.