Blogger Information
Blog 33
fans 0
comment 0
visits 19825
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
11月16日post传值--PHP培训九期线上班
取个名字真难
Original
651 people have browsed it

$_POST 变量

预定义的 $_POST 变量用于收集来自 method=”post” 的表单中的值。

从带有 POST 方法的表单发送的信息,对任何人都是不可见的(不会显示在浏览器的地址栏),并且对发送信息的量也没有限制。

注释:然而,默认情况下,POST 方法的发送信息的量最大值为 8 MB(可通过设置 php.ini 文件中的 post_max_size 进行更改).

post1.phpd代码

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>post传值得练习</title>
  5. </head>
  6. <body>
  7. <h1>post传值练习</h1>
  8. <form action="post2.php" method="post">
  9. <label for="name">输入用户名:</label>
  10. <input type="text" name="name" id="name">
  11. <label for="password">输入密码:</label>
  12. <input type="password" name="password"><br>
  13. <label for="email">输入邮箱:</label>
  14. <input type="email" name="email"><br>
  15. <button>提交</button>
  16. </form>
  17. </body>
  18. </html>

post2.php代码

  1. <?php
  2. echo "<h1>输出post接收的值</h1>";
  3. echo "接收到的name的值是:". $_POST['name'].'<br>';
  4. echo "接收到的password的值是:". $_POST['password'].'<br>';
  5. echo "接收到的email的值是:". $_POST['email'];
  6. ?>

效果如下



Correcting teacher:查无此人查无此人

Correction status:qualified

Teacher's comments:完成的不错,继续努力
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post