您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

这段代码一直有异常,麻烦大神看下

2026/2/7 18:45:36发布11次查看
<a href ='index.php' >返回留言板</a><hr><hr> <?php /* * to change the template for this generated file go to * window - preferences - phpeclipse - php - code templates */ require("conn.php"); $user=$_post['user']; $title=$_post['title']; $content=$_post['content']; $sql_luck="insert into sny (id,user,title,content,lastdate)value('','$user','$title','$content',now())" $sql="select user from sny where user='$user'"; $query =mysql_query($sql); $rows=mysql_fetch_array($query); if((!empty($_post['sub']))and($rows['user']==$user)){ //echo $content; echo "<script>alert('用户已存在,请重新输入');location.href='add2.php'</script>" ;exit; mysql_free_result($query);exit; } else{ mysql_query($sql_luck); echo"<script>alert('哟!成功!');location.href='index.php'</script>"; echo "插入成功"; } ?> <form action="add.php" method="post"> 用户:<input type="text" name="user" value="请输入用户名" size="20" maxlength="10"/><br/> 标题:<input type="text" name="title" value="请输入内容" size="40" maxlength="40"/><br/> 内容:<textarea name="content" rows="10" cols="50" wrap="off"> text</textarea> <br/> <input type="submit" name="sub" value="release"/><br/> <form/>
解决方案
你if判断仔细看看里边缕缕。好么?
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product