求救

求救

出现如下错误:

Notice: Use of undefined constant text1 - assumed 'text1' in C:\Program Files\Apache Group\Apache2\htdocs\my_chat\speak.php on line 16

Notice: Undefined index: text1 in C:\Program Files\Apache Group\Apache2\htdocs\my_chat\speak.php on line 16
程序如下:
---------------sys_conf.inc---------
<?php
class sys_conf{
public static $DBHOST="localhost";
public static $DBUSER="root";
public static $DBPWD="123456";
public static $DBNAME="my_chat";
}
?>

--------------main.php---------
<?php
session_start();
$user_name=$_POST["nick"];
session_register("user_name");
?>
<html><title>聊天室</title>
<frameset rows="80%,*">
<frame src="chat_display.php" name="chat_display">
<frame src="speak.php" name="speak">
</frameset>
</html>
-------------login.php-----------
<html><head><title>用户登陆</title></head><body>
<center><h1>欢迎来到啊飞聊天室</h1>
<h2>请输入你的昵称</h2>
<form action="main.php" method="post" target="_self">
<input type="text" name="nick" cols=20>
<input type="submit" value="登录">
</form>
</center>
</body>
</html>
---------------speak.php-----------
<?php
session_start();
?>
<html>
<head>
<title>
</title>
</head>
<body>
<?php
require_once("sys_conf.inc");
$host=sys_conf::$DBHOST;
$user=sys_conf::$DBUSER;
$pwd=sys_conf::$DBPWD;
$name=sys_conf::$DBNAME;
if($_POST[text1])
{
print"text";
$link_id=mysql_connect($host,$user,$pwd);
mysql_select_db($name);
$time=date("h:i:s");
$author=$_SESSION["user_name"];
$str="insert into chat(create_time, author, text ) values('$time','$author','$_POST[text1]')";
$result=mysql_query($str);
mysql_close($link_id);
}
?>
<form action="speak.php" method="post" target="_self">
<input type="text" name="text1" cols=20>
<input type="submit" value="发言">
</form>
</body>
</html>
---------------chat_display------------
<html><head><title></title>
<meta http-equiv="refresh" content="2";url="chat_display.php">
</head><body>
<?php
require_once("sys_conf.inc");
$host=sys_conf::$DBHOST;
$user=sys_conf::$DBUSER;
$pwd=sys_conf::$DBPWD;
$name=sys_conf::$DBNAME;
$link_id=mysql_connect($host,$user,$pwd);
mysql_select_db($name,$link_id);
$str="select * from chat order by create_time; ";
$result=mysql_query($str);
$rows=mysql_num_rows($result);
@mysql_data_seek($result,$rows-15);
if($rows<15)
$l=$rows;
else
$l=15;
for($i=1;$i<=$l;$i++)
{
list($cid,$author,$create_time,$text)=mysql_fetch_row($result);
echo $create_time; echo ""; echo "[".$author."[";
echo"说到:";
echo $text;echo "br>";
}
@mysql_data_seek($result,$rows-20);
list($limtime)=mysql_fetch_row($result);
$str="delete from chat where create_time<'$limtime';";
$result=mysql_query($str);
mysql_close($link_id);

?></body></html>
请高人指点

将speak.php的 if($_POST[text1])
改成 if(isset($_POST['text1']))
毕业了。。。

恩,试试看!先谢了!

现在就是,说的话,写不进数据库!
不怎么的!
请指教!