您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php $_POST接收表单数据实例代码

2024/10/16 5:18:23发布22次查看
在 php 中,预定义的 $_post 变量用于收集来自 method=post 的表单中的值。下面就为大家带来一篇php利用超级全局变量$_post来接收表单数据的实例。下面是代码:
<!doctype html> <html> <head> <title>利用超级全局变量$_post接收表单</title> <meta http-equiv="content-type" contnet="text/html" charset="utf-8"/> </head> <body> <form method="post" action="<?php echo $_server['php_self'];?>"/> name:<input type="text" name="fname"/> <input type="submit"/> </form> <?php $name= $_post['fname']; echo $name; ?> </body> </html>
输出内容使用post方式提交数据,然后用$_post['fname'];接收数据赋值到$name的全局变量中,
然后用echo输出$name;变量得到最终的结果,就是表单内的内容。...................
以上就是php $_post接收表单数据实例代码的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product