博客列表 >练习post传值-第九期(191118作业)

练习post传值-第九期(191118作业)

feng
feng原创
2019年11月19日 15:10:46646浏览

第九期-(191118作业)

一、练习post传值

代码:

  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <title>Document</title>
  9. </head>
  10. <body>
  11. <form action="" method="post">
  12. <label for="username">用户:</label>
  13. <input type="text" name="username" id="username" placeholder="请输入用户名">
  14. <label for="password">密码:</label>
  15. <input type="password" name="password" id="password" placeholder="请输入密码">
  16. <input type="submit" value="提交">
  17. </form>
  18. </body>
  19. </html>
  20. <?php
  21. print_r($_POST);
  22. echo '<hr>';
  23. echo $_POST['username'];
  24. echo '<br>';
  25. echo $_POST['password'];
  26. ?>

运行效果图

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议