<?php 
 session_start();
 ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发言页面</title>
<style type="text/css">
#co{width:400px; height:100px;}
</style>
</head>
<body>
<?php 
if (isset($_POST["text_color"])){
switch ($_POST["text_color"]){
case "红色":
$color="red";
break;
case "蓝色":
$color="blue";
break;
case "灰色":
$color="gray";
break;
default:
$_color="black";
break;
}
}
if (isset($_POST["text"])){
$con=mysql_connect("localhost","root","123456");
mysql_select_db("usermembers",$con);
mysql_query("set names 'gb2312'");
$spokeman=$_SESSION["user"];
$text=$_POST["text"];
$nowtime=date('Y-m-d-H:i:s',time());
$sql="insert into discussions (color,spokeman,spokecontent,spokedate) 
values('$color','$spokeman','$text','$nowtime')";
mysql_query($sql,$con); }
?>
<form action="speak.php" method="post" target="_self">
<textarea name="text" id="co"></textarea>
<input type="submit" value="发送">
<select name="text_color">
<?php 
switch ($color){
case "red":
$text_color="红色";
break;
case "blue":
$text_color="蓝色";
break;
case "gray":
$color="灰色";
break;
default:
$_color="";
break;
}
if (isset($text_color)){
?>
<option selected><?php echo $text_color; }?></option>
<option></option>
<option>红色</option>
<option>蓝色</option>
<option>灰色</option>
</select>
</form>
</body>
</html>
求救 ,为什么第一次可以发送到数据库并且在显示在聊天页面,但是第二次就写不进数据库了?求大神!第二次数据库没信息记录出现!