php聊天发言页面问题

来源:百度知道 编辑:UC知道 时间:2024/06/22 10:03:02
<?php session_start(); ?>
<html>

<head>
<title> 发言</itle>
</head>

<body>

<?php
require_once("sys_conf.inc") //系统配置文件,包含数据库配置信息
//发言
if(isset($_POST["text"]))
{
//连接数据库
$link_id=mysql_connect($DBHOST,$DBUSER,$DBPWD);
mysql_select_db($DBNAME);
$time=date("h:i:s");
$author=$_SESSION["user_name"];
$text=$_POST["text"];
$str="INSERT INTO chat
(ceate_time,autor,text) values('$time','$autor','$text');"
mysql_query($str,$link_id);
mysql_close($link_id);
}
?>
<!--输入表单--------->
<form action="spaek.php" method="post" target="_self">
<input type="text&qu

$str="INSERT INTO chat(ceate_time,autor,text) values('".$time."','".$autor."','".$text."');";
//这里改下!
//如果有错语你将$str打印出来在mysql里面运行看看! 一步一步的去找!