PHP: Når man opdatere lukket alt ned!
Hey, jeg har en kode i min 3Dchat hvor den viser de ting som er blevet smidt i rummet og hvilken mennesker der er i rummet.når man logger ind virker det perfekt, men efter den "opdatere" siden så kommer fejl meddelesen: "Internet explorer har fundet en fejl, og afsluttes."
Min kode er her, men MEGET rodet, da man ikke må lave linjebrud i java script:
<?php
session_start();
include("db.php");
$k = mysql_query("SELECT * FROM brugere WHERE brugernavn='$_SESSION[brugernavn]'");
$row = mysql_fetch_array($k);
?>
<?
if(isset($_SESSION['brugernavn'])) {
?><meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="page-enter" content="blendTrans(Duration=0, transition=15)">
<meta http-equiv="page-exit" content="blendTrans(Duration=0, transition=15)">
<body topmargin="0" onload="loadet();" leftmargin="0" oncontextmenu="return false" ondragstart="return false" onselectstart="return false">
<script>
parent.document.getElementById('chat').innerHTML = "<?php include("db.php"); $kl = mysql_query("SELECT * FROM naturechat_brugere WHERE rum = '$row[rum]' AND brugernavn <> '{$_SESSION['brugernavn']}' AND tfelt>=0 AND lfelt>=0"); WHILE($row1 = mysql_fetch_array($kl)){ echo "<div id='$row1[brugernavn]' style='width:100px; height:5px; z-index: 1; position:absolute; left:$row1[lfelt]px; top:$row1[tfelt]px;'><div align='center'><table ondragstart='return false' onclick='return false' align='center' width='27'cellpadding='0'cellspacing='0'><tr><td width='27' ondragstart='return false' onclick='return false' background='haar/$row1[haar]' height='10'></td></tr><tr><td width='27' background='hovede/$row1[hovede]' height='14'></td></tr></table><table ondragstart='return false' onclick='return false' align='center' cellpadding='0'cellspacing='0' ondragstart='return false' onclick='return false' width='44'><tr><td width='44' background='toj/$row1[toj]'height='22'></td></tr></table><table align='center'cellpadding='0' ondragstart='return false' onclick='return false' cellspacing='0'width='16'><tr><td width='15'background='sko/$row1[sko] 'height='7'></td></tr></table><font size='1' face='verdana' color='black'><font size=1 face='verdana' color='$row1[navnfarve]'><a href='seprofil.php?brugernavn=$row1[brugernavn]' target='tekstboks'> <b>$row1[brugernavn]</b></a></font></font></div></div>"; } ?> ";
parent.document.getElementById('laast').innerHTML = "<?php include("db.php"); $kl32 = mysql_query("SELECT * FROM chat_felter WHERE rum = '$row[rum]' AND tfelt>=0 AND lfelt>=0"); WHILE($row8 = mysql_fetch_array($kl32)){ echo "<div id='laast' style='width:200px; height:200px; z-index: 1; position:absolute; left:$row8[lfelt]px; top:$row8[tfelt]px;'><a href='#' style='cursor: default' ondragstart='return false' onclick='return false' ><img src='felt.gif' border='0' width='$row8[b]' ondragstart='return false' onclick='return false' height='$row8[h]'></a></div>"; } ?>";
parent.document.getElementById('ting').innerHTML = "<?php include("db.php"); $kl3 = mysql_query("SELECT * FROM ting WHERE rum = '$row[rum]' AND tfelt>=0 AND lfelt>=0"); WHILE($row3 = mysql_fetch_array($kl3)){ echo "<div id='ting' style='width:200px; height:200px; position:absolute; left:$row3[lfelt]px; top:$row3[tfelt]px;'><img height='$row3[h]' ondragstart='return false' onclick='return false' width='$row3[b]' src='$row3[figur]'></div> "; } ?>";
parent.document.getElementById('snupting').innerHTML = "<?php include("db.php"); $kl5 = mysql_query("SELECT * FROM ting WHERE rum = '$row[rum]' AND tfelt>=0 AND lfelt>=0"); WHILE($row5 = mysql_fetch_array($kl5)){ echo "<div id='snupting' style='width:200px; height:200px; z-index: 1; position:absolute; left:$row5[lfelt]px; top:$row5[tfelt]px;'><a style='cursor: default' href='samleop.php?id=$row5[id]' target=tekstboks ondragstart='return false' ><img src='dot_samle_op.gif' ondragstart='return false' width='13' border='0' height='12' border='0'></a></div>"; } ?>";
function loadet() {
setTimeout("location.reload(true)",10);
}
</script>
<?php
} else {
echo "<meta http-equiv='refresh' content='0;URL=../login.php'>";
}
?>