php 问题 Parse error: parse error, unexpected T_FUNCTION,老师改都出现问题,求大家的帮助呀!!!

这是message_process.php<?phpinclude("db_conn.php");include ("db_func.php");error_reporting(E_ALL);global $add;$add=turefunction ChangWord($NewWord){$newword=str_replace("\r\n","<br>",$NewWord);$newword=ereg_replace("[']+","'",$NewWord);}$time=date("y-m-d g:i:s");$ip=$REMOTE_ADDR;if($check=$add){$SQLStr="INSERT INTO message(m_title,m_content,m_time,m_user,m_mail,m_pass,m_mip) values('$title','".ChangWord($content)."','$time','$user','$email','$pass','$ip')";$message="添加留言成功!!";}db_query($SQLStr);?><script>alert("<?php echo $message;?> ");location.href="message_list.php?p=0";</script>这是message_post.php<?phperror_reporting(E_ALL);<form name="form1" method="post" action="message_process.php ?check=add"> <table width="481" border="1" cellpadding="0" cellspacing="0" align="center" > <tr> <td> <table width="480" border="0" align="center" cellspacing="1" bordercolor="#000099" cellpadding ="1"> <tr> <td height="10" colspan="2" bgcolor="#006699"> <div align="center"><font color="#EEEEEE" size="4">访问者留言</font><div> </td> </tr> <tr> <td height="30" bgcolor="#99ccff"> <div align="center" >留言人</div> </td> <td height="30" bgcolor="#99ccff"> <input type="text" name="user" size="20"> </td> </tr> <tr> <td height="23"> <div aligh="center">e-mail</div> </td> <td height="23"> <input type="text" name="email" size="36"> </td> </tr> <tr> <td height="23 bgcolor="99ccff"> <div align="center" >留言主题</div> </td> <td height="23 bgcolor="99ccff"> <input type="text" name="title" size="36"> </td> </tr> <tr> <td height="80"> <div align="center">留言内容</div> </td> <td height="80"> <p> <textarea name="content" rows="10"colos="35"> </textarea> <br> </p> </td> </tr> <tr> <td height="25"colspan="2" bgcolor="#006699"> <div align="center"> <input type="reset" name="reset" value="清除重填"》 <input type="submit" name="submit" value="送出留言"> </div> </td> </tr> </table> </td> </tr> </table> </form> ?>
2026-12-04 13:38:11
推荐回答(5个)
回答1:

$add=ture
function ChangWord($NewWord){
$newword=str_replace("\r\n","
",$NewWord);
$newword=ereg_replace("[']+","'",$NewWord);
}

拼写错误 没有结束符号;
$add=true;
你的这个函数根本不起作用啊,
1php区分大小写
2.没有返回值
下面的就没有看了,仔细检查一下把

回答2:

错误太多了
1.$add=ture
改成
$add=true;
2.
error_reporting(E_ALL);
下面的表单内容不要放到 里面

回答3:

这是message_post.php
error_reporting(E_ALL);
































访问者留言


留言人




e-mail




留言主题




留言内容














?>

这是什么语法?

回答4:

ereg_replace 这个5.2之后给淘汰了吧 换preg_replace

回答5:

老师改过? 错误好多,建议细细研读。