Online 3D chat
Hej,Jeg har nu arbejdet længe på chatten her og kan ikke komme videre jeg har lavet et system hvor man kan rykke rundt med en figur men man kan ikke se hinanden på chatten hvordan kan jeg lave det...?
P.S. er Newbie til Javascript og jeg har kodet det andet i php så noget kode tak!
<?
session_start();
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" " [url]http://www.w3.org/TR/html4/loose.dtd[/url]">
<html>
<head>
<title>HighTech-Huset</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#board {
border: 0px solid #000;
border-collapse: collapse;
}
#board td {
width: 60px;
height: 60px;
border:0px solid #AAA;
text-align: center;
vertical-align: middle;
}
body {
background-image: url();
background-color: #000000;
}
body,td,th {
color: #FFFFFF;
}
</style>
<?php
if(isset($_SESSION['logget_ind'])){
$db = mysql_connect("Mysqlhost", "mysqluser", "mysqlkode");
mysql_select_db("mysqldatabase",$db);
$get_toj = mysql_query("SELECT * FROM brugere WHERE brugernavn = '$_SESSION[brugernavn]'");
$load = mysql_fetch_array($get_toj);
$toj = $load['toj'];
?>
<script type="text/javascript">
var last_field = null;
function moveElement(idx) {
obj = document.getElementById(idx);
if (last_field != null) last_field.innerHTML = ' ';
document.getElementById(idx).innerHTML = '<div><img src=" <?php echo "$toj"; ?> "><br><br></div>';
last_field = obj;
}
</script>
</head>
<body>
<table width="500" height="390" border="0" align="center" background="gfx/rooms/stuen.JPG" id="board">
<tr>
<td width="58" height="384" id="1_1" onClick="moveElement(this.id)"></td>
<td width="58" id="1_2" onClick="moveElement(this.id)"></td>
<td width="58" id="1_3" onClick="moveElement(this.id)"></td>
<td width="58" id="1_4" onClick="moveElement(this.id)"></td>
<td width="58" id="1_5" onClick="moveElement(this.id)"></td>
<td width="58" id="1_6" onClick="moveElement(this.id)"></td>
<td width="58" id="1_7" onClick="moveElement(this.id)"></td>
<td width="58" id="1_8" onClick="moveElement(this.id)"></td>
</tr>
<tr>
<td height="364" id="2_1" onClick="moveElement(this.id)"></td>
<td id="2_2" onClick="moveElement(this.id)"></td>
<td id="2_3" onClick="moveElement(this.id)"></td>
<td id="2_4" onClick="moveElement(this.id)"></td>
<td id="2_5" onClick="moveElement(this.id)"></td>
<td id="2_6" onClick="moveElement(this.id)"></td>
<td id="2_7" onClick="moveElement(this.id)"></td>
<td id="2_8" onClick="moveElement(this.id)"></td>
</tr>
<tr>
<td height="364" id="3_1" onClick="moveElement(this.id)"></td>
<td id="3_2" onClick="moveElement(this.id)"></td>
<td id="3_3" onClick="moveElement(this.id)"></td>
<td id="3_4" onClick="moveElement(this.id)"></td>
<td id="3_5" onClick="moveElement(this.id)"></td>
<td id="3_6" onClick="moveElement(this.id)"></td>
<td id="3_7" onClick="moveElement(this.id)"></td>
<td id="3_8" onClick="moveElement(this.id)"></td>
</tr>
<tr>
<td height="364" id="4_1" onClick="moveElement(this.id)"></td>
<td id="4_2" onClick="moveElement(this.id)"></td>
<td id="4_3" onClick="moveElement(this.id)"></td>
<td id="4_4" onClick="moveElement(this.id)"></td>
<td id="4_5" onClick="moveElement(this.id)"></td>
<td id="4_6" onClick="moveElement(this.id)"></td>
<td id="4_7" onClick="moveElement(this.id)"></td>
<td id="4_8" onClick="moveElement(this.id)"></td>
</tr>
<tr>
<td height="364" id="5_1" onClick="moveElement(this.id)"></td>
<td id="5_2" onClick="moveElement(this.id)"></td>
<td id="5_3" onClick="moveElement(this.id)"></td>
<td id="5_4" onClick="moveElement(this.id)"></td>
<td id="5_5" onClick="moveElement(this.id)"></td>
<td id="5_6" onClick="moveElement(this.id)"></td>
<td id="5_7" onClick="moveElement(this.id)"></td>
<td id="5_8" onClick="moveElement(this.id)"></td>
</tr>
</table>
<script type="text/javascript">moveElement('1_1');</script>
<?
} else{
echo "Du skal være logget ind for at kunne chatte!";
}
?>
</body>
</html>
