Пишу с книги , выбивает ошибку - Parse error: syntax error, unexpected T_ENDWHILE in C:\Program Files\Apache Group\Apache2\htdocs\test\header.phtml on line 23 PHP: <? include ("tools.phtml"); session_register("person" , "pass"); $kto = file($file_kto_in_chat); $fi = count($kto); $met = -1; $i = 0; while ($i <= $fi); $str = trim(str_replace ("\n","", $kto [$i])); if ($str) { list ($name_kto, $time_kto) = split ("~", $str); if (($time_nast-$time_kto) > $chat_number and $name_kto != $person) { $kto [$i] = ""; $sav = "$name_rob~$time~ Ушел $name_kto~ \n"; $fp = fopen($file_logchat, "a+"); if ($fp) {$fw = fwrite($fp , $sav ); fclose ($fp); } } if ($name_kto == $person ) { $met = $i; $i = 10000;} } $i++; endwhile; if ($met == -1) { $sav = "$name_rob~$time~Вошел $person~\n"; $fp = fopen($file_logchat, "a+"); if ($fp) {$fw = fwrite($fp, $sav); fclose($fp); } $kto[] = "$person~$time_nast\n"; } else { $kto[$met] = "$person~$time_nast\n"; } $sav = implode("\n", $kto); $sav = str_replace ("\n\n","\n", $sav); $sav = str_replace ("\n\n","\n", $sav); $fp = fopen($file_kto_in_chat, "w"); if ($fp) {$fw = fwrite($fp, $sav); fclose($fp); } ?> <html><headxtitle>Пример чата </title> <meta http-equiv="Content-Type" content= "text/html; charset=windows-1251"></head> <frameset framespacing="0" rows="54,*,70"> <frame name="banner" scrolling="no" noresize target="banner" scr="banner.phtml"> <frameset cols="200,*"> <frame name="userlist" target="userlist" scr="userlist.phtml" frameborder = "0" scrolling= "1"> <frame name ="main_window" scr="main_window.phtml" frameborder="0"> </frameset> <frame name="msg" scrolling="no" noresize target ="msg" scr="msg.phtml" frameborder="0"> </frameset>
Тут еще одна ошиька но ткоа в другом файле. .. Parse error: syntax error, unexpected ';' in C:\Program Files\Apache Group\Apache2\htdocs\test\main_window.phtml on line 34 PHP: <? include ("tools.phtml"); ?> <html><head> <meta http-equiv="Content-Type" content= "text/html; charset=windows-1251"> <meta http-equiv=Refresh content="5; URL=main_windows.phtml"> <style type=text/css> body { scrollbar-face-color:#546A8C; scrollbar-3dlight-color:#FFFFFF; scrollbar-track-color: #FFFFFF; scrollbar-arrow-color: #FFFFFF; scrollbar-border-color:#000000 } p {font: Verdana; font-size : 12;} </style> <body bgcolor=#E7E7E7> <p> <? $user= file($file_logchat); $i = count ($user); $fi=$i-30; if ($fi < 0) {$fi = 0;} while ($i >= $fi): list ($name, $time_name, $msg, $komu) = split ("~", trim(str_replace("\n","", $user [$i]))); if ($name and $msg) { if (!$komu or $komu == $person) { if (!$komu) { echo "<small>$time_name </small> <b> для $name от $komu:</b> $msg<br>"; } } } $i-; endwhile; ?> <br></body> </html>
sam http://www.php.net/manual/en/langref.php Читать весь раздел и не превращать форум в удаленную отладку синтаксических ошибок.