i have this php pages
index.php
<?php
include 'viewannouncement.php';
?>
viewannouncement.php
<?php
$result = mysql_query("SELECT announcement_date,announcement_title,
announcement_text FROM sp_announcement") or die(mysql_error());
echo "<table id=\"newspaper-b\">";
echo "<thead>";
echo "<tr>";
echo "<th scope=\"col\">Date</th>";
echo "<th scope=\"col\">Title</th>";
echo "<th scope=\"col\">Announcement</th>";
echo "</tr>";
echo "</thead>";
while($row = mysql_fetch_array( $result )) {
echo "<tr>";
echo '<td>' . $row['announcement_date'] . '</td>';
echo '<td>' . $row['announcement_title'] . '</td>';
echo '<td>' . $row['announcement_text'] . '</td>';
echo "</tr>";
}
echo "</table>";
echo "<br>";
echo "<br>";
?>
in index.php it has a tab which includes and views viewannouncement.php, the problem is when i access the subpages manually it leaves a whitescreen, how can i make it redirect to index.php and still be view able via the tabs in index.php
i hope you guys can help me, any help is greatly appreciated
Typically people set a variable to check if a file was included or not,
Why not do something like this?
In your index file
Then in your file viewannouncement.php, try this at the top.