首页文件为index.html,代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>测试首页</title>
</head>
<body>
<form name="form1" method="post" action="Message_Recive.php">
<input name="strContent" type="text" value="" />
<input name="submit" type="Submit" value="提交" />
</form>
</body>
</html>
接收数据页面为Message_Recive.php,代码如下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Messag_Recive</title>
</head>
<body>
<?php
############################################################
//接收参数 strContent
############################################################
$strContent = #HTTP_POST_VARS['strContent'];
echo $strContent;
?>
</body>
</html>
结果出现如下错误:
Parse error: syntax error, unexpected T_ECHO in D:\Apache\htdocs\Message_Recive.php on line 14