ďťż

[PHP] Bład w skrypcie chatu ?

       

Podstrony


telcocafe

Witam,

Ostatnio znalazłem w internecie skrypt chat'u napisany w php,
niestety nie działa on u mnie poprawnie...
gdy zamierzam otworzyć plik INDEX.PHP pojawja mi się napis:

Parse error: syntax error, unexpected T_STRING in C:\Program Files\WebServ\httpd\chat\index.php on line 6

Co robić ?

Kod pliku INDEX.PHP

<? setcookie("$online"); if($online == "ja") { echo("<font face="verdana">Jesteś online!</font>"); exit; } ?> <html> <head> <title>Patt Cafe - v2.5</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> <meta http-equiv="Pragma" Content="no-cache"> <meta http-equiv="Refresh" Content="40"> <BODY bgcolor="#333366" text="FFFFFF" link="#FFFFFF" vlink="#FFFFFF"> <STYLE TYPE="text/css"> #przycisk { background-color: #CCCC99; color: #000000;> </Style> <style fprolloverstyle>A:hover {color: #000099}</style> </head> <BODY> <CENTER> <nobr> <BR><BR><BR> <TABLE WIDTH="500" background="tlo.gif" align="center"> <TR> <TD> <CENTER> <IFRAME src="history.htm" Width="490" hight="200" scrolling="no"></IFRAME> <BR> <body onload="document.login.navn.focus()"> <script language="javascript" type="text/javascript"> if (self != top) top.location = self.location; </script> <form action="chat.php" method="post" name="login"> Login: <input type="text" maxlength="15" name="navn"> <input type="submit" value="Wejdz" id="przycisk"> </form> <A HREF="obraz.htm" TITLE="Dostępne obrazki (emiticony)" TARGET="_blank">Obrazki;</A> </CENTER> </TD></TR></TABLE> </CENTER> </body> </html>

Kod pliku ADMIN.PHP

<? $password = "admin"; if($action == "doit" && $pass == $password) { $fil = "history.htm"; $str = "<TABLE><tr><td colspan="1"><I><font face="Arial" size="2" color="#FF0000"><b>".date("H:i:s",time())." Komentarz:</b> $chatten</font></I></td></tr></TABLE> "; $fp = fopen($fil, r); if($fp) { $fileArray = file($fil); $result = implode("", $fileArray); $result = "$str$result"; fclose($fp); } $fp = fopen($fil, w); if($fp) { fputs($fp,$result); fclose($fp); } } ?> <html> <meta http-equiv="Pragma" Content="no-cache"> <meta http-equiv="Refresh" Content="60"> <CENTER> <IFRAME src="history.htm" Width="490" hight="200" scrolling="no"></IFRAME> <BR><BR>narzędzia admina ;))) <BR><BR> <font face="verdana"> <form action="admin.php" method="post"> <input type="hidden" name="action" value="doit"> Haslo:<BR> <input type="password" name="pass" value="<? echo("$pass"); ?>"><br> Komentarz:<BR> <input type="text" name="chatten"><br> <input type="submit" value="Wyslij"> </form> </font> <BR><BR><BR> <? $password = "ban8520ban"; if($action == "doit" && $pass == $password) { $fil = ".htaccess"; $str = "deny from "; $fp = fopen($fil, r); if($fp) { $fileArray = file($fil); $result = implode("", $fileArray); $result = "$str$result"; fclose($fp); } $fp = fopen($fil, w); if($fp) { fputs($fp,$result); fclose($fp); } } ?> <BR> <font face="verdana"> <form action="admin.php" method="post"> <input type="hidden" name="action" value="doit"> Haslo:<BR> <input type="password" name="pass" value="<? echo("$pass"); ?>"><br> Banuj (z IP, host lub serwer proxy):<BR> <input type="text" name="chatten"><br> <input type="submit" value="Wyslij"> </form> </font> </CENTER> </html>

Kod pliku CHAT.PHP

<? header("Cache-Control: no-cache"); header("Pragma: no-cache"); setcookie("$coknavn"); if($navn==admin10) { $navn = "admin <B><I>(admin)</I></B>"; } if($navn == $coknavn) { header("refresh: 1; url=logaf.php?action=logaf&navn=$navn&doh=nisser"); print("<font face="verdana">Zaraz obraz zostanie odswiezony...</font>"); exit; } elseif($navn == "chatten" or $navn == "Chatten" or $navn == "") { header("refresh: 2; url=index.php"); echo("<font face="verdana">Zaraz obraz zostanie odswiezony...</font>"); exit; } setcookie("coknavn","$navn",time()+1440); setcookie("online","ja",time()+1440); $fil = "history.htm"; $str = "<TABLE><tr><td colspan="1"><font face="verdana" size="1" color="#FF0000">".date("H:i:s | d-m-Y")."<B> Chatten:</b> $navn ($REMOTE_ADDR) </font></td></tr></TABLE> "; $fp = fopen($fil, r); if($fp) { $fileArray = file($fil); $result = implode("", $fileArray); $result = "$str$result"; fclose($fp); } $fp = fopen($fil, w); if($fp) { fputs($fp,$result); fclose($fp); } ?> <html> <head> <title>Patt Cafe - v2.5 </title> </html> <frameset rows="*,110" border="0"> <frameset rows="*,1" border="0"> <frame name="hent" src="hent.php?navn=<? echo("$navn"); ?>" scrolling="no" noresize> <frame name="logaf" src="logaf.php?navn=<? echo("$navn"); ?>" scrolling="no" noresize> </frameset> <frame name="skriv" src="skriv.php?navn=<? echo("$navn") ?>" scrolling="no" noresize> </frameset>

Kod pliku HENT.PHP

<? setcookie("$coknavn"); if($navn == $coknavn) { header("refresh: 5"); ?> <html> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> <meta http-equiv="Pragma" Content="no-cache"> <BODY bgcolor="#CCCC99"> <table border="0"> <? $fcontents = file("history.htm"); while(list($line_num, $line) = each($fcontents)) { if($line_num == "0") { echo("$line"); } if($line_num == "1") { echo("$line"); } if($line_num == "2") { echo("$line"); } if($line_num == "3") { echo("$line"); } if($line_num == "4") { echo("$line"); } if($line_num == "5") { echo("$line"); } if($line_num == "6") { echo("$line"); } if($line_num == "7") { echo("$line"); } if($line_num == "8") { echo("$line"); } if($line_num == "9") { echo("$line"); } if($line_num == "10") { echo("$line"); } if($line_num == "11") { echo("$line"); } if($line_num == "12") { echo("$line"); } if($line_num == "13") { echo("$line"); } if($line_num == "14") { echo("$line"); } if($line_num == "15") { echo("$line"); } if($line_num == "16") { echo("$line"); } if($line_num == "17") { echo("$line"); } if($line_num == "18") { echo("$line"); } if($line_num == "19") { echo("$line"); } } ?> </table> </html> <? exit; } ?>

Kod pliku LOGAF.PHP

<? if($action == "logaf") { setcookie("coknavn","udlobet",time()+1); setcookie("online","nej",time()+1); $fil = "history.htm"; $str = "<TABLE><tr><td colspan="1"><font face="verdana" size="1" color="#0000CC">".date("H:i:s | d-m-Y")."<B> Chatten:</b> Opuscil(a) nas $navn </font></td></tr></TABLE> "; $fp = fopen($fil, r); if ($fp) { $fileArray = file($fil); $result = implode("", $fileArray); $result = "$str$result"; fclose($fp); } $fp = fopen($fil, w); if ($fp) { fputs($fp, $result); fclose($fp); } if($doh == "nisser") { header("location: index.php"); exit; } ?> <script Language="Javascript"> window.close(); </SCRIPT> <? exit; } ?> <html> <meta http-equiv="Pragma" Content="no-cache"> <script language="Javascript"> var exit=true; function xit() { if (exit) open("logaf.php?action=logaf&navn=<? echo("$navn") ?>","_blank","width=1, height=1, scrollbars=0,status=0,menubar=0,resizable=0,location=0,toolbar=0"); } </script> <body onunload="xit()" > </body> </html>

Kod pliku SKRIV.PHP

<? setcookie("$coknavn"); if($navn && $skriv && strlen($skriv)<=100 && $coknavn == $navn) { setcookie("coknavn","$navn"); $skriv = ereg_replace("<","&lt;",$skriv); $skriv = ereg_replace(">","&gt;",$skriv); $skriv = ereg_replace(":)","<img src="images/usmiech.gif" border="0">",$skriv); $skriv = ereg_replace(":(","<img src="smutny.gif" border="0">",$skriv); $skriv = ereg_replace(":wow","<img src="images/wow.gif" border="0">",$skriv); $skriv = ereg_replace(":cmok","<img src="images/cmok.gif" border="0">",$skriv); $skriv = ereg_replace(":papa","<img src="images/papa.gif" border="0">",$skriv); $skriv = ereg_replace("??","<img src="images/pytajnik.gif" border="0">",$skriv); $skriv = ereg_replace("!!","<img src="images/wykrzyknik.gif" border="0">",$skriv); $fil = "history.htm"; $str = "<TABLE><tr><td><font face="verdana" size="1" color="$coloruser"><b>".date("H:i:s",time())." $navn:</b></font><font face="verdana" size="$wielkoscx" color="$farve" style="font-weight: $gruboscx" style="font-variant: $kapitalikix">&nbsp;&nbsp;$skriv</font></td></tr></TABLE> "; $fp = fopen($fil, r); if ($fp) { $fileArray = file($fil); $result = implode("", $fileArray); $result = "$str$result"; fclose($fp); } $fp = fopen($fil, w); if ($fp) { fputs($fp, $result); fclose($fp); } } ?> <html> <meta http-equiv="Pragma" Content="no-cache"> <BODY bgcolor="#333366" text="FFFFFF" link="#FFFFFF" vlink="#FFFFFF"> <STYLE TYPE="text/css"> #przycisk { background-color: #CCCC99; color: #000000;> </Style> <style fprolloverstyle>A:hover {color: #000099}</style> <body onload="document.submit_form.skriv.focus()"> <CENTER> <form action="skriv.php" method="post" name="submit_form"> <input type="hidden" name="navn" value="<? echo("$navn"); ?>"> Kolor: <select name="farve"> <? if($farve == "darkred"){ echo("<option value="darkred">Czerwony</option>"); } ?> <? if($farve == "darkblue"){ echo("<option value="darkblue">Niebieski</option>"); } ?> <? if($farve == "darkgreen"){ echo("<option value="darkgreen">Zielony</option>"); } ?> <option value="black">Czarny</option> <option value="darkred">Czerwony</option> <option value="darkblue">Niebieski</option> <option value="darkgreen">Zielony</option> </select> <form action="skriv.php" method="post" name="submit_form"> <input type="hidden" name="navn" value="<? echo("$navn"); ?>"> Wielkosc: <select name="wielkoscx"> <? if($wielkoscx == "1"){ echo("<option value="1">Mniejsza</option>"); } ?> <? if($wielkoscx == "3"){ echo("<option value="3">Wieksza</option>"); } ?> <? if($wielkoscx == "4"){ echo("<option value="4">Najwieksza</option>"); } ?> <option value="2">Standartowa</option> <option value="1">Mniejsza</option> <option value="3">Wieksza</option> <option value="4">Najwieksza</option> </select> <form action="skriv.php" method="post" name="submit_form"> <input type="hidden" name="navn" value="<? echo("$navn"); ?>"> Pogrubienie: <select name="gruboscx"> <? if($gruboscx == "700"){ echo("<option value="700">grubsza</option>"); } ?> <? if($gruboscx == "900"){ echo("<option value="900">najgrubsza</option>"); } ?> <option value="normal">normalna</option> <option value="700">grubsza</option> <option value="900">najgrubsza</option> </select> <form action="skriv.php" method="post" name="submit_form"> <input type="hidden" name="navn" value="<? echo("$navn"); ?>"> Kapitaliki: <select name="kapitalikix"> <? if($kapitalikix == "small-caps"){ echo("<option value="small-caps">small-caps</option>"); } ?> <option value="normal">normalna</option> <option value="small-caps">small-caps</option> </select> <BR> <form action="skriv.php" method="post" name="submit_form"> <input type="hidden" name="navn" value="<? echo("$navn"); ?>"> Kolor nick`u: <select name="coloruser"> <? if($coloruser == "#0000FF"){ echo("<option value="#0000FF">Niebieski</option>"); } ?> <? if($coloruser == "#000099"){ echo("<option value="#000099">Granatowy</option>"); } ?> <? if($coloruser == "#00FF00"){ echo("<option value="#00FF00">Zielony</option>"); } ?> <? if($coloruser == "#CCCC99"){ echo("<option value="#CCCC99">Niewidoczny</option>"); } ?> <? if($coloruser == "#FF9933"){ echo("<option value="#FF9933">Pomaranczowy</option>"); } ?> <? if($coloruser == "#FFFF00"){ echo("<option value="#FFFF00">Zolty</option>"); } ?> <? if($coloruser == "#FF00FF"){ echo("<option value="#FF00FF">Rozowy</option>"); } ?> <option value="#000000">Czarny</option> <option value="#0000FF">Niebieski</option> <option value="#000099">Granatowy</option> <option value="#00FF00">Zielony</option> <option value="#CCCC99">Niewidoczny</option> <option value="#FF9933">Pomaranczowy</option> <option value="#FFFF00">Zolty</option> <option value="#FF00FF">Rozowy</option> </select> &#160 <input type="text" maxlength="100" name="skriv"> <input type="submit" name="send" id="przycisk" value="Wyslij"> </form> </CENTER> <nobr> <A HREF="outlog.htm" TITLE="Wyloguj sie" TARGET="_top">Wyloguj sie;</A> &#160 &#160 <A HREF="obraz.htm" TITLE="Dostepne obrazki (emiticony)" TARGET="_blank">Obrazki;</A> &#160 &#160 <A HREF="historia.htm" TITLE="Historia" TARGET="_blank">History;</A> </nobr> </body> </html>

Kod pliku HISTORY.HTM

<BODY bgcolor="C0C0C0">

Kod pliku OBRAZ.HTM

<Html> <head> <meta http-equiv="Content-Type" content=text/html; charset=iso-8859-2"> <META NAME="Language" CONTENT="pl"> <META NAME="Author" CONTENT="Patt"> <title>Emoticony</title> <LINK REL=stylesheet HREF="styl.css" TYPE="text/css"> <BODY bgcolor="#333366" text="FFFFFF" link="#FFFFFF" vlink="#FFFFFF"> </head> <BODY> <nobr> <CENTER>Wstawianie obrazkow (emiticon):</CENTER> <BR> <BR> <center> Wystarczy wpisac nazwe<BR> Oto lista rysunkow (obok kazdego obrazka jest nazwa):<BR><BR> <TABLE Width="480" BORDER="1" background="images/tlo.gif"> <TR> <TD> <IMG SRC="images/wesoly.gif"> :)<BR> <IMG SRC="images/smutny.gif"> :(<BR> </TD><TD> <IMG SRC="images/wow.gif"> :wow<BR> <IMG SRC="images/cmok.gif"> :cmok<BR> <IMG SRC="images/papa.gif"> :papa<BR> </TD><TD> <IMG SRC="images/wykrzyknik.gif"> !!<BR> <IMG SRC="images/pytajnik.gif"> ??<BR> </TD></TR> </TABLE> </center> </nobr> </body> </html>

Kod pliku STYLE.CSS

<STYLE TYPE="text/css"> BODY { font: 12 Arial; color: #FF0000 } #przycisk { background-color: #000099; color: #FFFF00;> </Style> <STYLE type="text/css"> <!-- BODY { scrollbar-face-color: #000000; scrollbar-highlight-color: #000000; scrollbar-3dlight-color: #FF0000; scrollbar-darkshadow-color: #000000; scrollbar-shadow-color: #FF0000; scrollbar-arrow-color: #FFFFFF; scrollbar-track-color: #000000; } --> </STYLE>

Sorka za długośc posta ale w każdym z kodów może być bład ;)

Źródło skryptu: http://xklonos.cal.p...kuly.php?t=chat



index.php - linia 6:
echo('<font face="verdana">Jesteś online!</font>');

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • nvm.keep.pl

  • Sitedesign by AltusUmbrae.