就是一个输入流, 可以获得POST的原始数据.

echo file_get_contents("php://input");

//示例代码

//test.html

  1. <html>
  2. <head>
  3. <!--set title-->
  4. <title> test php://input </title>
  5. </head>
  6. <!--show page-->
  7. <body>
  8. <form action = "input.php" method="post">
  9. 用户名: <input type="text" name="user"> <br>
  10. 密码:<input type="password" name="password"> <br>
  11. <input type="submit">
  12. </form>
  13. </body>
  14. </html>

//input.php

  1. <html>
  2. <head>
  3. <!--set title-->
  4. <title> test php://iput web </title>
  5. </head>
  6. <!--show page-->
  7. <body>
  8. <?php
  9. echo"post data: <br>/n";
  10. echofile_get_contents("php://input");
  11. ?>
  12. </body>
  13. </html>

 

相关文章:

  • 2022-12-23
  • 2021-06-11
  • 2021-12-06
  • 2021-09-24
  • 2022-03-10
猜你喜欢
  • 2021-09-29
  • 2021-08-21
  • 2022-01-16
相关资源
相似解决方案