Okay so I have a function that is called fillDiv and it's suppose to update the div when I click it. And it doesn't seem to want to apply that when I have an account logged in, but it works fine when I am on the home page. I have even tried using firebug but it can't find anything. So I am here....
dom.js
function $(id){
return document.getElementById(id);
}
function fillDiv(id,data){
$(id).innerHTML = data;
}
index.php
<html>
<table class="main">
<tr class="head"><td>
<head>
<meta http-equiv="expires" content="text/html; charset=utf-8" />
<?php require("head.php"); ?>
</head>
</tr></td>
<tr><td>
<body>
<div id="body">
<div id="charinfo">
<?php
echo"Hello $char[username]!";
print("fillDiv('fight','Just a test.');");
?>
</div>
<hr>
<div id="fight"></div>
<hr>
<div id="chat"><?php
include("CHAT/index.php");
?></div>
</div>
</body>
</tr></td>
<tr><td>
<div id="foot">
<?php include("foot.php"); ?>
</div>
</td></tr>
</table>
</html>
head.php
<link href="home.css" rel="stylesheet" type="text/css" />
<title>Rise Of Immortals!</title>
<div id="topper"><img src="../IMAGE/title.JPG"></div>
<?php
include("../connect.php");
$player=isset($_COOKIE['userid']);
$password=isset($_COOKIE['password']);
if(!$player)
die("Where is your id?<br><br>You are not logged in! <a href=http://www.riseofimmortals.com>Login</a>");
$query = "SELECT * FROM users WHERE id='$player'";
$result = mysql_query($query) or die(mysql_error());
$char = mysql_fetch_array($result) or die(mysql_error());
if($password != $char['password'])
die("What is your password?<br><br>You are not logged in! <a href=http://www.riseofimmortals.com>Login</a>");
?>
<script src="../ajax.js" type="text/javascript"></script>
<script src="../dom.js" type="text/javascript"></script>
<script src="../gamefunctions.js" type="text/javascript"></script>
<div id="homenav"><a href="http://www.riseofimmortals.com/MAIN/index.php">Main</a> | <a href="Javascript: viewLogout();">Logout</a></div>
<div class="hr"><hr /></div>
Not sure what to do.....
The display in charinfo div comes out as "Hello Beffic!fillDiv('fight','Just a test.'); " and the fight div doesn't change at all.... Any idea?