after i used jquery.load() it doesnt read the includes on index.php and makes home.php unreadable, heres my sample code. but if i manually added the contents of sqlcon.php on home.php it works, how can i fix this?
index.php
require 'sqlcon.php';
include 'portal.php';
portal.php
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/ajax.js" type="text/javascript"></script>
<div id="nav">
<ul>
<li><a href="modules/menu/home.php" class="nav">Home</a></li>
<li><a href="modules/menu/setup.php" class="nav"> Setup</a></li>
</ul>
</div>
<div id="subnav"></div>
home.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>";
ajax.js
$(document).ready(function() {
$('a.nav').click(function() {
var url = $(this).attr('href');
$('#subnav').load(url);
return false;
});
});
<?php-tag?