首页 > php怎么用$_post函数接收来自html中的表单的数据

php怎么用$_post函数接收来自html中的表单的数据

刚开始学习php 网上查了很多也不能用$_post函数打印出表单的数据
这是代码
HTML部分

<html>
<head>
<title>php test</title>
<meta charset=utf-8>
<body >
<form action="01.php"method="post"name="form1" >
<table>
<tr>
    <td>fs</td>
    <td><input name="fs"type="text"></td>
    <td><input type="submit"value="提交"></td>
</tr>
</table>
</form>
</body>
</head>
</html>
PHP部分

<?php
$fs=$_post['fs'];
echo $fs;
?>
按提交按钮后只能打印出php的代码


$_POST

大写。


php变量是区分大小写的,方法,函数名和常量不区分(但是仍然要求一致),需要像楼上这位朋友说的一样要大写,使用$_POST[],还有你说可以打印出php代码,我看应该不会的.

【热门文章】
【热门文章】