自己不创建数据啊………,回复完自己跳转走了。就是不创建
@数据……,到mysql管理去看没数据…
试了下,'$eii[0]',确实输出的是昵称…
好像建数据那点没执行…
求指导…
<?php
session_start();
$bt="回复帖子";
include("../top.php");
include("../conn.php");
include_once("../function.php");
$sid = sqlstr($_COOKIE['dl']);
$uin=mysql_fetch_array(mysql_query("select * from user where sid='$sid'"));
$id=$uin['id'];
$nick=$uin['nick'];
if(!$uin){
header("Location:../login.php");
exit;
}
$tid=sqlstr($_GET['tid']);
$hftime=time();
$hftxt=$_POST["hftxt"];
$text=htmlspecialchars($_POST["hftxt"]);
$txt=sqlstr(nl2br($text));
if($txt==Null){
echo '<br/><font color="red">很无语啊:</font><br/>你什么都不写,你想表达什么呢?写一点吧。<br/><br/><br/>';
}elseif(mb_strlen($txt,'utf-8')>50){
echo "回复字数不能大于50哦,唯爱时光装不下啦~ <br/><br/><br/>";
}else{
if($_SESSION['hf']!=$txt){
$_SESSION['hf']="${txt}";
$hf="UPDATE tie SET hf=hf+1 WHERE tid='$tid'";
mysql_query($hf,$conn);
$rss=mysql_query("INSERT INTO hf(hid,hftxt,uid,tid,hftime) VALUES ('','$text','$id','$tid','$hftime')");
if($rss){
$hftxt=preg_replace("!(@|@)([\\x{4e00}-\\x{9fa5}A-Za-z0-9_\\-]{1,})(\x20| |<|\xC2\xA0|\r|\n|\x03|\t|,|\\?|\\!|:|;|,|。|?|!|:|;|、|…|$)!ue","'@\\2 \\3'",$hftxt);
if (preg_match('/@/', $hftxt)){
$ei = explode('@', $hftxt);
$num = count($ei);
$num = $num - 1;
for ($i = 1; $i <= $num; $i++) {
$eii = explode(',', $ei[$i]);
$eii = explode(' ', $ei[$i]);
$row=mysql_query("SELECT * FROM user WHERE nick='$eii[0]'");
$row=$row['0'];
if(is_array($row)){
$time=time();
mysql_query("INSERT INTO ait(atid, kan,fnick,time,nick,tzid) VALUES ('', '0', '$eii[0]', '$time', '$nick', '$time')");
}
}}
}
header("Location:read.php?tid=$tid");
exit;
}else{
echo "<br/><br/><font color='red'>不可重复回复。</font><br/> <br/><a href='index.php'>返回首页</a><br/><br/> ";
}
}
?>
<?php
include('../foot.php');
foot_staring();
?>