As the title suggest's I get that error in my Code. i beleive it is to do with the Part of the script i just put in. Heres all of my Code =
<?php
//CHAT SCRIPT BY MICKYG
//TO USE THIS SCRIPT YOU MUST KEEP THIS HERE
//YOU MUST ALSO PUT A LINK ON YOUR CHAT TO [url]WWW.MICKYG.CO.UK[/url]
//THIS CHAT SCRIPT IS FREE AS LONG AS YOU ABIDE BY THE ABOVE CONDITIONS
//TO REMOVE THE LINK TO [url]WWW.MICKYG.CO.UK[/url] AND TO REMOVE THIS INFORMATION EMAIL ME AT [email]MICKYG@MICKYG.CO.UK[/email]
//--------------------------
//Variables
$name = $_POST['myName'];;
$tosave = $_POST['myChat'];;
$closeit = ("0");
$openit = ("1");
$closed = ("thechat=Chat is Closed, Sorry.");
$reset = ("thechat=");
$opened = ("thechat=Chat is open again");
$file = file_get_contents ("chat.txt");
$working = file_get_contents ("online.txt");
$adcloseit = ("adminhere=0");
$adopenit = ("adminhere=1");
//Name commands
if ($name == "FCC5000") {
$name = str_replace("FCC5000","<u><font color=\"#FF0000\">ADMIN</font></u>", $name);
$highpower = ("1");
} elseif ($name == "4115000") {
$name = str_replace("4115000","<u><font color=\"#0000FF\">MOD</font></u>", $name);
$highpower = ("1");
} else {
$highpower = ("0");
}
$save = ("$file<br>
<b>$name</b>:<i>$tosave</i><br>");
$kicksend = ("$file<br>
<b>Robot</b>:<i>$tosave</i><br>");
if (($pos = strpos($tosave, '*//*')) !== false) {
list($kickmd, $namekick) = explode("*//*", $tosave);
$kickfile = file_get_contents ("kick.txt");
if ($kickcmd == "/kick") {
$kicksave = ("$kickfile,$namekick");
if ($highpower == "1") {
$fpkk = fopen("kick.txt", "w");
if(fwrite($fpkk, $kicksave)) ;
fclose($fpkk);
$kicksend = ("$file<br>
<b>Robot</b>:<i>$namekick Was Kicked</i><br>");
$fpvv = fopen("chat.txt", "w");
if(fwrite($fpvv, $kicksend)) ;
fclose($fpvv);
}
} else {
//output Commands
switch ($tosave) {
case "/close":
if ($highpower == "1") {
$fpclose = fopen("online.txt", "w");
if(fwrite($fpclose, $closeit)) ;
fclose($fpclose);
break;
}
case "/open":
if ($highpower == "1") {
$fpopen = fopen("online.txt", "w");
if(fwrite($fpopen, $openit)) ;
fclose($fpopen);
$fpo = fopen("chat.txt", "w");
if(fwrite($fpo, $opened)) ;
fclose($fpo);
break;
}
case "/signinad":
if ($highpower == "1") {
$fpadon = fopen("adon.txt", "w");
if(fwrite($fpadon, $adopenit)) ;
fclose($fpadon);
break;
}
case "/signoutad":
if ($highpower == "1") {
$fpadoff = fopen("adon.txt", "w");
if(fwrite($fpadoff, $adcloseit)) ;
fclose($fpadoff);
break;
}
case "/t+cs":
if ($highpower == "1") {
$tcs = ("flashcmd=TCS");
$fptc = fopen("flashcmds.txt", "w");
if(fwrite($fptc, $tcs)) ;
fclose($fptc);
break;
}
case "/emergencyexit":
if ($highpower == "1") {
$emr = ("flashcmd=EMER");
$fpemr = fopen("flashcmds.txt", "w");
if(fwrite($fpemr, $emr)) ;
fclose($fpemr);
break;
}
case "/flashnorm":
$fno = ("flashcmd=norm");
$fpfno = fopen("flashcmds.txt", "w");
if(fwrite($fpfno, $fno)) ;
fclose($fpfno);
break;
case "XREPORTX":
$to = 'mjgriffiths@hotmail.com';
$subject = 'REPORT IN CHAT. REPORT IN CHAT';
$message = "REOPRT IN CHAT. GO NOW Chat File as Follows!! $file";
$headers = 'From: [email]warning@mickyg.co.uk[/email]' . "\r\n" .
'Reply-To: [email]mjgriffiths@hotmail.com[/email]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
break;
case "/contact":
$savecon = ("$file<br><br><b><u>ADMIN emails are [email]mjgriffiths@hotmail.com[/email] and [email]mickyg@mickyg.co.uk[/email]</b></u>");
$fpcon = fopen("chat.txt", "w");
if(fwrite($fpcon, $savecon)) ;
fclose($fpcon);
break;
case "/savechat":
$newchatno = rand(1, 5000);
$newchat = ("chat.$newchatno.txt");
$fpsc = fopen("chats/$newchat", "w");
if(fwrite($fpsc, $file)) ;
fclose($fpsc);
break;
default:
if($working == "0"){
$fpa = fopen("chat.txt", "w");
if(fwrite($fpa, $closed)) ;
fclose($fpa);
} else {
$replaced = str_replace("xxREDxx","<font color=\"#FF0000\">", $save);
$replaced2 = str_replace("xx:CLRxx","</font>", $replaced);
$replaced3 = str_replace("xxGRNxx","<font color=\"#00FF00\">", $replaced2);
$replaced5 = str_replace("xx:)xx","<img src='http://users.pandora.be/eforum/emoticons4u/happy/1016.gif'>", $replaced3);
$replaced6 = str_replace("xUx","</i>", $replaced5);
$replaced7 = str_replace("x:Ux","<i>", $replaced6);
$replaced8 = str_replace("x-x","<u>", $replaced7);
$replaced9 = str_replace("x:-x","</u>", $replaced8);
$replaced10 = str_replace("Xx","<b>", $replaced9);
$replaced11 = str_replace("xX","</b>", $replaced10);
$replaced12 = str_replace("xxPNKxx","<font color=\"#FF33CC\">", $replaced11);
$replaced14 = str_replace("xxGRYxx","<font color=\"#999999\">", $replaced12);
$replaced16 = str_replace("xxBLUxx","<font color=\"#0000FF\">", $replaced14);
$replaced17 = str_replace("xxYELxx","<font color=\"#FFFF00\">", $replaced16);
$replaced18 = str_replace("xxBLAxx","<font color=\"#000000\">", $replaced17);
$replaced19 = str_replace("xxIMGxx","<img src='", $replaced18);
$replaced20 = str_replace("xx:IMGxx","'>", $replaced19);
$fp = fopen("chat.txt", "w");
if(fwrite($fp, $replaced20)) ;
fclose($fp);
}
}
}
echo ("$replaced20");
//--------------------------
//CHAT SCRIPT BY MICKYG
//TO USE THIS SCRIPT YOU MUST KEEP THIS HERE
//YOU MUST ALSO PUT A LINK ON YOUR CHAT TO [url]WWW.MICKYG.CO.UK[/url]
//THIS CHAT SCRIPT IS FREE AS LONG AS YOU ABIDE BY THE ABOVE CONDITIONS
//TO REMOVE THE LINK TO [url]WWW.MICKYG.CO.UK[/url] AND TO REMOVE THIS INFORMATION EMAIL ME AT [email]MICKYG@MICKYG.CO.UK[/email]
?>
And This is the New Bit =
if (($pos = strpos($tosave, '*//*')) !== false) {
list($kickmd, $namekick) = explode("*//*", $tosave);
$kickfile = file_get_contents ("kick.txt");
if ($kickcmd == "/kick") {
$kicksave = ("$kickfile,$namekick");
if ($highpower == "1") {
$fpkk = fopen("kick.txt", "w");
if(fwrite($fpkk, $kicksave)) ;
fclose($fpkk);
$kicksend = ("$file<br>
<b>Robot</b>:<i>$namekick Was Kicked</i><br>");
$fpvv = fopen("chat.txt", "w");
if(fwrite($fpvv, $kicksend)) ;
fclose($fpvv);
}
} else {
And That If statement above is terminated at the end of the Switch statement.
Sorry its problerley a really easy error,
++ The unexpected $ is on line 207 which is this line =
?>
.... So i don't think the $ is there to be honest...
thanks,
MickyG