birdbrain24
02-05-2008, 03:33 AM
How could i add AJAX to this page so that when the POST methos page is changed it will just get the new include instead of having to reload the page?
Also if it can not work how my page is set up i am willing to change my page to make it work! So if anyone could help please do so!
Thanks!
<html>
<head>
<title>RACE</title>
<link rel="stylesheet" href="style.css" type="text/css">
<script type="text/javascript" src="javascript.js"></script>
</head>
<body>
<?php
# Common functions!
session_start();
include 'functions.php';
connect();
sessioncheck();
lastaction();
?>
<table align="center" cellspacing="5">
<tr>
<td align="right" width="175" style='vertical-align: top; padding: 0px;'><?php require_once 'menu.php'; ?></td>
<td align="center" style='vertical-align: top; padding: 0px;'><?php if(isset($_GET['page'])):
$page = $_GET['page'];
$file_to_include = $page . ".php";
if(file_exists($file_to_include)):
include($file_to_include);
else:
header('Location: index2.php?page=news');
endif;
else:
header('Location: index2.php?page=news');
endif; ?></td>
<td align="left" width="175" style='vertical-align: top; padding: 0px;'><?php require_once 'stats.php'; ?></td>
</tr>
</table>
</body>
</html>
Also if it can not work how my page is set up i am willing to change my page to make it work! So if anyone could help please do so!
Thanks!
<html>
<head>
<title>RACE</title>
<link rel="stylesheet" href="style.css" type="text/css">
<script type="text/javascript" src="javascript.js"></script>
</head>
<body>
<?php
# Common functions!
session_start();
include 'functions.php';
connect();
sessioncheck();
lastaction();
?>
<table align="center" cellspacing="5">
<tr>
<td align="right" width="175" style='vertical-align: top; padding: 0px;'><?php require_once 'menu.php'; ?></td>
<td align="center" style='vertical-align: top; padding: 0px;'><?php if(isset($_GET['page'])):
$page = $_GET['page'];
$file_to_include = $page . ".php";
if(file_exists($file_to_include)):
include($file_to_include);
else:
header('Location: index2.php?page=news');
endif;
else:
header('Location: index2.php?page=news');
endif; ?></td>
<td align="left" width="175" style='vertical-align: top; padding: 0px;'><?php require_once 'stats.php'; ?></td>
</tr>
</table>
</body>
</html>