Blogger Information
Blog 27
fans 0
comment 0
visits 17372
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
016-11月18日-PHP第6节模板,POST,函数
冇忉丼
Original
516 people have browsed it

1. 练习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="usr">登录名:</label><input type="text" id="usr" name="usrname" value="" >
  13. <label for="password">密码:</label><input type="password" id="password" name="password" value="" >
  14. <button>提交</button>
  15. </form>
  16. </body>
  17. </html>
  18. <?php
  19. print_r($_POST);//用post请求更安全,请看下图
  20. ?>


2. 函数自行学习一些

  1. <?php
  2. echo '系统函数有以下常用类:
  3. String 字符串操作
  4. Array 数组操作
  5. MySQLi 数据库操作
  6. Filesystem 文件类型
  7. Mail 数学函数
  8. HTTP 服务器发送信息操作
  9. Date 日期
  10. Calendar 日历
  11. ';
  12. echo '<hr/>';
  13. echo '以下为字符串操作函数:';
  14. echo '<hr/>';
  15. echo strtolower('GUOJING');
  16. echo '<hr/>';
  17. echo strlen('anguoguo');
  18. echo '<hr/>';
  19. // $a = $_GET('A');
  20. echo trim(' 去掉空格 ');
  21. echo '<hr/>';
  22. $b = '是的,you are right!';
  23. echo str_replace('是的','Yes',$b);
  24. echo '<hr/>';
  25. $arr=[
  26. '帅气',
  27. '的' ,
  28. '我',
  29. ];
  30. echo implode('--',$arr);
  31. echo '<hr/>';
  32. echo md5('anguoguo'); //加密成32位的码,一般用于用户密码
  33. ?>

运行效果如下图:

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