$titles= $_POST['title']; $check_query = mysql_query("select title from emlog_blog where title='$titles' limit 1"); if(mysql_fetch_array($check_query)){ echo '<script>alert("您添加的文章名称已经存在。");window.history.back(-1);</script>'; exit; }