It doesn't work, what I'm assuming, when the echo comes it's not starting the function.
Can you help?
<?php
include("lib.php");
define("PAGENAME", "Resting");
$player = check_user($secret_key, $db);
?>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript">
function updateTable() {
$.load('enhp.php');
alert("You healed 1HP and 1Energy point!");
}
</script>
</head>
<?php
echo '<center>';
if ($player->hp == $player->maxhp && $player->energy == $player->maxenergy)
{
echo "<i>You have full HP and Energy.</i>\n";
exit;
}
else
{
if ($_GET['act'] == "rest") {
echo '<script type="text/javascript">setInterval("updateTable()",12000);</script>';
echo 'You are now resting. You will gain 1hp and 1energy point every 5 seconds. To unrest type "unrest"';
}
}
echo '</center>';
?>