Warning:preg_match() [function.preg-match]:Compilation failed:nothing to repeat Warning:preg_match() [function.preg-match]:Compilation failed:nothing to repeat at offset 0 in E:\EasyPHP-5.3.4.0\www\01\note_check.php on line 9 怎么修改,望各高手帮帮我啊?
程序如下:
php
alert('留言信息中包含敏感词!');history.back(-1);";exit;}}}$content =$_POST['content'];$user_name = $_POST['user_name'];$title = $_POST['title'];$mood= $_GET['mood'];$head = $_POST['head'].".gif";$note_flag=$_POST['checkbox'];if($note_flag!=1){$note_flag=0;}$datetime=date("Y-m-d H:i:s");$sql = "insert into tb_note (note_user,note_title,note_content,note_mood,note_time,note_user_pic,note_flag) values('".$user_name."','".$title."','".$content."','".$mood."','".$datetime."','".$head."','".$note_flag."')";$DB->query($sql);$url = "./index.php";redirect_once($url);}?>------解决方案--------------------你的 $filter_word[$i] 中包含了 perl 保留字,尤其是 ?、+、*需要转义正确的写法是preg_match("/".preg_quote(trim($filter_word[$i]))."/i",$str)
