Avatar billede sconie Nybegynder
14. oktober 2002 - 20:24 Der er 10 kommentarer og
1 løsning

Chat vindue

Davz allz

Jeg og så en ven(kaw) er igang med at programmere en chat men vi har lig et problem med chat vinduet. Skriver lige kode og fejlen.

Parse error: parse error, unexpected $ in /var/www/fastweb/users/zeattle/chatverdendesign/chat/chat.php on line 566

Der kommer nok flere fejl når i retter den i den linie, men alle fejl skal rettes hvis i kan.
Her er koden til chat vinduet:

<?



// CHIKANE STOPPER - Ny forbedret version





// Kopier scriptet ind på de sider, hvor du vil blokere bestemte brugere



$ip = getenv('REMOTE_ADDR');



if (($ip == "195.249.246.249") || ($ip == "62.107.35.127") || ($ip == "80.63.79.136") || ($ip == "80.197.56.167")){ //IP-adresserne du vil blokere



echo '<p><font color=#FF0000 face=Verdana size=2>Din adgang til denne side er blokeret "NAR"</font></p>';



exit;



}else{



}



?>



<?



session_start();



include("db.php");



?>



<style>



A:link {color : <? echo $row5[navnfarve]; ?>;text-decoration: none}



A:visited {color : <? echo $row5[navnfarve]; ?>;text-decoration: none}



A:active {color : <? echo $row5[navnfarve]; ?>;text-decoration: none}



A:hover {color : <? echo $row5[navnfarve]; ?>;text-decoration: underline}



</style>



<SCRIPT>



if (window.Event)



  document.captureEvents(Event.MOUSEUP);



function nocontextmenu()



{



event.cancelBubble = true



event.returnValue = false;



return false;



}



function norightclick(e)



{



if (window.Event)



{



  if (e.which == 2 || e.which == 3)



  return false;



}



else



  if (event.button == 2 || event.button == 3)



  {



  event.cancelBubble = true;



  event.returnValue = false;



  return false;



  }



}



document.oncontextmenu = nocontextmenu;



document.onmousedown = norightclick;



</SCRIPT>



<meta http-equiv="Page-Enter" content="blendTrans(Duration0.01)">



<SCRIPT LANGUAGE=javascript>



<!--



var newDateObj = new Date()



setTimeout("location.reload()", 5000)



//-->



</SCRIPT>



<?



$result = mysql_query("SELECT * FROM brugersystem where brugernavn='$brugernavn'");



$row = mysql_fetch_array($result);



?>



<?





if($row[brugernavn] == "") {





echo"<FONT FACE=\"Verdana\" SIZE=\"5\" COLOR=\"#000000\">DU ER IKKE LOGGET IND</FONT>";





?>




<?





} else {





?>



<?



if($rum < 89) {



$result99 = mysql_query("SELECT * FROM rooms where nr='$rum'");



$row99 = mysql_fetch_array($result99);



}



if($rum == 90) {



$result99 = mysql_query("SELECT * FROM adminrooms where nr='$rum'");



$row99 = mysql_fetch_array($result99);



}



if($rum == 91) {



$result99 = mysql_query("SELECT * FROM adminrooms where nr='$rum'");



$row99 = mysql_fetch_array($result99);



}



if($rum == 92) {



$result99 = mysql_query("SELECT * FROM adminrooms where nr='$rum'");



$row99 = mysql_fetch_array($result99);



}



if($rum == 93) {



$result99 = mysql_query("SELECT * FROM adminrooms where nr='$rum'");



$row99 = mysql_fetch_array($result99);



}



if($rum == 94) {



$result99 = mysql_query("SELECT * FROM adminrooms where nr='$rum'");



$row99 = mysql_fetch_array($result99);



}



if($rum == 95) {



$result99 = mysql_query("SELECT * FROM adminrooms where nr='$rum'");



$row99 = mysql_fetch_array($result99);



}



if($rum > 99) {



$result99 = mysql_query("SELECT * FROM lejligheder where nr='$rum'");



$row99 = mysql_fetch_array($result99);



}



?>



<body background="images/bg/<? echo $row99[bg]; ?>.jpg" leftmargin="0" topmargin="0" style="background-repeat: no-repeat;">



<DIV STYLE="text-align:center;"><FONT FACE="Verdana" SIZE="1" COLOR="<? echo $row99[overfarve]; ?>"><B><? echo $row99[navn]; ?></B></FONT></DIV>



<?



$result4 = mysql_query("SELECT * FROM 3dchat where brugernavn='$brugernavn'");



$row4 = mysql_fetch_array($result4);



?>



<?



$result = mysql_query("SELECT * FROM brugersystem where brugernavn='$brugernavn'");



$row = mysql_fetch_array($result);



?>



<?



if($brugernavn == $row[brugernavn] && $kodeord == $row[kodeord]) {



?>



<?



if($felt == NULL) { $felt == "1"; }



if($felt == "1") { $x = 0; $y = 0; }



if($felt == "2") { $x = 68; $y = 0; }



if($felt == "3") { $x = 136; $y = 0; }



if($felt == "4") { $x = 204; $y = 0; }



if($felt == "5") { $x = 272; $y = 0; }



if($felt == "6") { $x = 340; $y = 0; }



if($felt == "7") { $x = 0; $y = 62; }



if($felt == "8") { $x = 68; $y = 62; }



if($felt == "9") { $x = 136; $y = 62; }



if($felt == "10") { $x = 204; $y = 62; }



if($felt == "11") { $x = 272; $y = 62; }



if($felt == "12") { $x = 340; $y = 62; }



if($felt == "13") { $x = 0; $y = 124; }



if($felt == "14") { $x = 68; $y = 124; }



if($felt == "15") { $x = 136; $y = 124; }



if($felt == "16") { $x = 204; $y = 124; }



if($felt == "17") { $x = 272; $y = 124; }



if($felt == "18") { $x = 340; $y = 124; }



if($felt == "19") { $x = 0; $y = 186; }



if($felt == "20") { $x = 68; $y = 186; }



if($felt == "21") { $x = 136; $y = 186; }



if($felt == "22") { $x = 204; $y = 186; }



if($felt == "23") { $x = 272; $y = 186; }



if($felt == "24") { $x = 340; $y = 186; }



if($felt == "25") { $x = 0; $y = 248; }



if($felt == "26") { $x = 68; $y = 248; }



if($felt == "27") { $x = 136; $y = 248; }



if($felt == "28") { $x = 204; $y = 248; }



if($felt == "29") { $x = 272; $y = 248; }



if($felt == "30") { $x = 340; $y = 248; }



if($felt == "31") { $x = 0; $y = 310; }



if($felt == "32") { $x = 68; $y = 310; }



if($felt == "33") { $x = 136; $y = 310; }



if($felt == "34") { $x = 204; $y = 310; }



if($felt == "35") { $x = 272; $y = 310; }



if($felt == "36") { $x = 340; $y = 310; }



else { $felt == "1"; }



?>



<?



$result1 = mysql_query("SELECT * FROM duzer_3dchat where felt='$felt' && rum='$rum'");



$row1 = mysql_fetch_array($result1);



if($felt == $row1[felt]) {} else {



?>



<?



mysql_query("update duzer_3dchat set x = '$x' where brugernavn = '$brugernavn'");



mysql_query("update duzer_3dchat set y = '$y' where brugernavn = '$brugernavn'");



mysql_query("update duzer_3dchat set rum = '$rum' where brugernavn = '$brugernavn'");



mysql_query("update duzer_3dchat set felt = '$felt' where brugernavn = '$brugernavn'");



}



?>



<font>



<a href="chat1528.php?felt=1&rum=<? echo $rum; ?>"><div id="Layer1" style="position:absolute; width:68px; height:62px; z-index:5; left: 0px; top: 0px"></div></a>



<a href="chat1528.php?felt=2&rum=<? echo $rum; ?>"><div id="Layer2" style="position:absolute; width:68px; height:62px; z-index:5; left: 68px; top: 0px"></div></a>



<a href="chat1528.php?felt=3&rum=<? echo $rum; ?>"><div id="Layer3" style="position:absolute; width:68px; height:62px; z-index:5; left: 136px; top: 0px"></div></a>



<a href="chat1528.php?felt=4&rum=<? echo $rum; ?>"><div id="Layer4" style="position:absolute; width:68px; height:62px; z-index:5; left: 204px; top: 0px"></div></a>



<a href="chat1528.php?felt=5&rum=<? echo $rum; ?>"><div id="Layer5" style="position:absolute; width:68px; height:62px; z-index:5; left: 272px; top: 0px"></div></a>



<a href="chat1528.php?felt=6&rum=<? echo $rum; ?>"><div id="Layer6" style="position:absolute; width:68px; height:62px; z-index:5; left: 340px; top: 0px"></div></a>



<a href="chat1528.php?felt=7&rum=<? echo $rum; ?>"><div id="Layer7" style="position:absolute; width:68px; height:62px; z-index:5; left: 0px; top: 62px"></div></a>



<a href="chat1528.php?felt=8&rum=<? echo $rum; ?>"><div id="Layer8" style="position:absolute; width:68px; height:62px; z-index:5; left: 68px; top: 62px"></a> </div>



<a href="chat1528.php?felt=9&rum=<? echo $rum; ?>"><div id="Layer9" style="position:absolute; width:68px; height:62px; z-index:5; left: 136px; top: 62px"></a> </div>



<a href="chat1528.php?felt=10&rum=<? echo $rum; ?>"><div id="Layer10" style="position:absolute; width:68px; height:62px; z-index:5; left: 204px; top: 62px"></a> </div>



<a href="chat1528.php?felt=11&rum=<? echo $rum; ?>"><div id="Layer11" style="position:absolute; width:68px; height:62px; z-index:5; left: 272px; top: 62px"></a> </div></a>



<a href="chat1528.php?felt=12&rum=<? echo $rum; ?>"><div id="Layer12" style="position:absolute; width:68px; height:62px; z-index:5; left: 340px; top: 62px"></a> </div></a>



<a href="chat1528.php?felt=13&rum=<? echo $rum; ?>"><div id="Layer13" style="position:absolute; width:68px; height:62px; z-index:5; left: 0px; top: 124px"></a> </div></a>



<a href="chat1528.php?felt=14&rum=<? echo $rum; ?>"><div id="Layer14" style="position:absolute; width:68px; height:62px; z-index:5; left: 68px; top: 124px"></a> </div></a>



<a href="chat1528.php?felt=15&rum=<? echo $rum; ?>"><div id="Layer15" style="position:absolute; width:68px; height:62px; z-index:5; left: 136px; top: 124px"></a> </div></a>



<a href="chat1528.php?felt=16&rum=<? echo $rum; ?>"><div id="Layer16" style="position:absolute; width:68px; height:62px; z-index:5; left: 204px; top: 124px"> </div></a>



<a href="chat1528.php?felt=17&rum=<? echo $rum; ?>"><div id="Layer17" style="position:absolute; width:68px; height:62px; z-index:5; left: 272px; top: 124px"> </div></a>



<a href="chat1528.php?felt=18&rum=<? echo $rum; ?>"><div id="Layer18" style="position:absolute; width:68px; height:62px; z-index:5; left: 340px; top: 124px"> </div></a>



<a href="chat1528.php?felt=19&rum=<? echo $rum; ?>"><div id="Layer19" style="position:absolute; width:68px; height:62px; z-index:5; left: 0px; top: 186px"> </div></a>



<a href="chat1528.php?felt=20&rum=<? echo $rum; ?>"><div id="Layer20" style="position:absolute; width:68px; height:62px; z-index:5; left: 68px; top: 186px"> </div></a>



<a href="chat1528.php?felt=21&rum=<? echo $rum; ?>"><div id="Layer21" style="position:absolute; width:68px; height:62px; z-index:5; left: 136px; top: 186px"> </div></a>



<a href="chat1528.php?felt=22&rum=<? echo $rum; ?>"><div id="Layer22" style="position:absolute; width:68px; height:62px; z-index:5; left: 204px; top: 186px"> </div></a>



<a href="chat1528.php?felt=23&rum=<? echo $rum; ?>"><div id="Layer23" style="position:absolute; width:68px; height:62px; z-index:5; left: 272px; top: 186px"> </div></a>



<a href="chat1528.php?felt=24&rum=<? echo $rum; ?>"><div id="Layer24" style="position:absolute; width:68px; height:62px; z-index:5; left: 340px; top: 186px"> </div></a>



<a href="chat1528.php?felt=25&rum=<? echo $rum; ?>"><div id="Layer25" style="position:absolute; width:68px; height:62px; z-index:5; left: 0px; top: 248px"> </div></a>



<a href="chat1528.php?felt=26&rum=<? echo $rum; ?>"><div id="Layer26" style="position:absolute; width:68px; height:62px; z-index:5; left: 68px; top: 248px"> </div></a>



<a href="chat1528.php?felt=27&rum=<? echo $rum; ?>"><div id="Layer27" style="position:absolute; width:68px; height:62px; z-index:5; left: 136px; top: 248px"> </div></a>



<a href="chat1528.php?felt=28&rum=<? echo $rum; ?>"><div id="Layer28" style="position:absolute; width:68px; height:62px; z-index:5; left: 204px; top: 248px"> </div></a>



<a href="chat1528.php?felt=29&rum=<? echo $rum; ?>"><div id="Layer29" style="position:absolute; width:68px; height:62px; z-index:5; left: 272px; top: 248px"> </div></a>



<a href="chat1528.php?felt=30&rum=<? echo $rum; ?>"><div id="Layer30" style="position:absolute; width:68px; height:62px; z-index:5; left: 340px; top: 248px"> </div></a>



<a href="chat1528.php?felt=31&rum=<? echo $rum; ?>"><div id="Layer31" style="position:absolute; width:68px; height:62px; z-index:5; left: 0px; top: 310px"> </div></a>



<a href="chat1528.php?felt=32&rum=<? echo $rum; ?>"><div id="Layer32" style="position:absolute; width:68px; height:62px; z-index:5; left: 68px; top: 310px"> </div></a>



<a href="chat1528.php?felt=33&rum=<? echo $rum; ?>"><div id="Layer33" style="position:absolute; width:68px; height:62px; z-index:5; left: 136px; top: 310px"> </div></a>



<a href="chat1528.php?felt=34&rum=<? echo $rum; ?>"><div id="Layer34" style="position:absolute; width:68px; height:62px; z-index:5; left: 204px; top: 310px"> </div></a>



<a href="chat1528.php?felt=35&rum=<? echo $rum; ?>"><div id="Layer35" style="position:absolute; width:68px; height:62px; z-index:5; left: 272px; top: 310px"> </div></a>



<a href="chat1528.php?felt=36&rum=<? echo $rum; ?>"><div id="Layer36" style="position:absolute; width:68px; height:62px; z-index:5; left: 340px; top: 310px"> </div></a>



<?



$result1 = mysql_query("SELECT * FROM duzer_3dchat where rum='$rum'");



while($row1 = mysql_fetch_array($result1)) {



?>



<?



$result5 = mysql_query("SELECT * FROM duzer_brugere where brugernavn='$row1[brugernavn]'");



$row5 = mysql_fetch_array($result5);



?>



<?



if($row5[figur] == "") {



?>



<div id="divbox" style="z-index:6; position:absolute; width:68px; height:62px; left: <? echo $row1[x]; ?>px; top: <? echo $row1[y]; ?>px"><img src="images/figure/fejl.gif" border="0"><br><center><font size="1" face="verdana" color="<? echo $row5[navnfarve]; ?>"><a href="uinfo.php?id=<? echo $row5[id]; ?>" target="mas"><FONT FACE="Verdana" SIZE="1" COLOR="<? echo $row5[navnfarve]; ?>"><? echo $row1[brugernavn]; ?></FONT></a></div>



<?



} else {



?>



<div id="<? echo $row1[id]; ?>" style="z-index:6; position:absolute; width:68px; height:62px; left: <? echo $row1[x]; ?>px; top: <? echo $row1[y]; ?>px"><img src="images/figure/<? echo $row5[figur]; ?>.gif" border="0"><br><center><font size="1" face="verdana" color="<? echo $row5[navnfarve]; ?>"><a href="uinfo.php?id=<? echo $row5[id]; ?>" target="mas"><FONT FACE="Verdana" SIZE="1" COLOR="<? echo $row5[navnfarve]; ?>"><? echo $row1[brugernavn]; ?></FONT></a></div>



<?



}



?>



<?



$yt = $row1[y] - 20;



$xt = $row1[x] + 50;



?>







<? } } ?>



<?



if($rum > 99) {



?>



<?



$result4 = mysql_query("SELECT * FROM duzer_lejligheder where ejer='$brugernavn'");



$rowen = mysql_fetch_array($result4);



?>



<?



if($rowen[nr] == $rum) {



?>



<?



$result2 = mysql_query("SELECT * FROM duzer_ting where rum='$rum' AND ejer = ''");



while($row2 = mysql_fetch_array($result2)) {



?>



<div id="ting" style="position:absolute; z-index:3; width:0px; height:0px; left: <? echo $row2[x]; ?>px; top: <? echo $row2[y]; ?>px"><img src="images/items/<? echo $row2[url]; ?>.gif"></div>



<div id="tag" style="position:absolute; z-index:10; width:0px; height:0px; left: <? echo $row2[x]; ?>px; top: <? echo $row2[y]; ?>px"><a href="samlop.php?id=<? echo $row2[id]; ?>" target="mas"><img src="images/items/tag.gif" border="0"></a></div>



<?



}



?>



<?



} else {



?>



<?



$result2 = mysql_query("SELECT * FROM duzer_ting where rum='$rum' AND ejer = ''");



while($row2 = mysql_fetch_array($result2)) {



?>



<div id="ting" style="position:absolute; z-index:3; width:0px; height:0px; left: <? echo $row2[x]; ?>px; top: <? echo $row2[y]; ?>px"><img src="images/items/<? echo $row2[url]; ?>.gif"></div>



<?



}



?>



<?



}



?>



<?



} else {



?>



<?



$result2 = mysql_query("SELECT * FROM duzer_ting where rum='$rum' AND ejer = ''");



while($row2 = mysql_fetch_array($result2)) {



?>



<div id="ting" style="position:absolute; z-index:3; width:0px; height:0px; left: <? echo $row2[x]; ?>px; top: <? echo $row2[y]; ?>px"><img src="images/items/<? echo $row2[url]; ?>.gif"></div>



<div id="tag" style="position:absolute; z-index:10; width:0px; height:0px; left: <? echo $row2[x]; ?>px; top: <? echo $row2[y]; ?>px"><a href="samlop.php?id=<? echo $row2[id]; ?>" target="mas"><img src="images/items/tag.gif" border="0"></a></div>









<? } } ?>



<?



$result6 = mysql_query("SELECT * FROM duzer_visit where rum='$rum' AND link = 'open'");



while($row6 = mysql_fetch_array($result6)) {



?>



<div id="rekvisit" style="position:absolute; z-index:9; width:0px; height:62px; left: <? echo $row6[x]; ?>px; top: <? echo $row6[y]; ?>px"><a href="<? echo $row6[til]; ?>" target="_new_"><img src="images/andet/<? echo $row6[url]; ?>.gif" border="0"></div></a>

<?



flush();



sleep(-1000);



?>

Håber nogle kan hjælpe..

//neller/kaw - www.zeattle.dk  / www.zeattle.tk  ( det er chatten )
Avatar billede ztyxx Nybegynder
14. oktober 2002 - 20:26 #1
og hvis du så lige viste koden for linien med fejl.....
Avatar billede sconie Nybegynder
14. oktober 2002 - 20:32 #2
hele koden er jo lgie der så lig da in i et program må du jo kunne se...
Avatar billede dmcn Praktikant
14. oktober 2002 - 20:37 #3
Med den holdning skal du nok ikke regne med at få specielt meget hjælp.
Avatar billede ztyxx Nybegynder
14. oktober 2002 - 20:37 #4
jo, men det er meget kode at sidde og ræse igennem for dem der ikke bruger en editor med linienummering
Avatar billede sconie Nybegynder
14. oktober 2002 - 20:45 #5
den viser over 1000 linier mere så et er ikke den linie mere....
Avatar billede ztyxx Nybegynder
14. oktober 2002 - 20:47 #6
skal det så forstås på den måde, at man skal, enten gætte sig frem, eller kigge en masse kode igennem, man ikke kender opbygningen af?
Avatar billede sconie Nybegynder
14. oktober 2002 - 20:47 #7
den viser lidt over 1000 linier nu det gjorde den ikke før såå kan ikke engang selv hjælpe nu
Avatar billede 123maka Nybegynder
14. oktober 2002 - 20:50 #8
Parse error: parse error, unexpected $ in /var/www/fastweb/users/zeattle/chatverdendesign/chat/chat.php on line 566
Avatar billede ztyxx Nybegynder
14. oktober 2002 - 20:54 #9
det må være linien der hedder
if($felt == "25") { $x = 0; $y = 248; }
Avatar billede sconie Nybegynder
14. oktober 2002 - 20:56 #10
hm der er bare ikke noget galt der...
Avatar billede sconie Nybegynder
15. oktober 2002 - 19:28 #11
lukker...har fundet ud af det selv...
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester



IT-JOB