php聊天室的问题
我在网上看到别人的代码 下来学习 可是有问题一直调试不成功,自己也看了好久没找到原因,请大家帮我看看
错误提示是:Parse error: syntax error, unexpected T_STRING, expecting T_CASE or T_DEFAULT or '}'
代码:
<html>
<meta http-equiv="Refresh" content="5; url=view.php?room=<?php echo $room; ?>">
<body bgcolor="#cccccc">
<?
switch ($room) {
case '大厅':
$write_file="1.txt";
break;
case '客房':
$write_file="2.txt";
break;
case '后院':
$write_file="3.txt";
break;
default:
$write_file="0.txt";
break;
}
$chat_lenght = 25;
$lines = file($write_file);
$a = count($lines);
$u = $a - $chat_lenght;
for($i = $a; $i >= $u ;$i--){
echo $lines[$i] . "<br>";
}
?>
</body>
</html>