php script to log the raw data of POST

前端 未结 4 1723
Happy的楠姐
Happy的楠姐 2020-12-09 12:54

I am sending data using HTTP POST to my server. But in the server, I am not receiving the data. And somehow I don\'t have any way to check the data (or debug script) on clie

相关标签:
4条回答
  • 2020-12-09 13:31

    Write post data to a file:

    file_put_contents('/tmp/postdata.txt', var_export($_POST, true));
    
    0 讨论(0)
  • 2020-12-09 13:37

    You can try sniffing the HTTP session.

    0 讨论(0)
  • 2020-12-09 13:37

    try using var_dump($_POST['name-of-field']) or var_dump($_POST)

    updated:// and browse the source of the page and look for an array

    0 讨论(0)
  • 2020-12-09 13:44

    You can see the content of post data inline (not for production) with:

    print_r($_POST);
    

    Or if you want to see POST, GET and COOKIE data:

    print_r($_REQUEST);
    

    If you need to log, since the client is very limited - try outputting the POST data to a file:

    file_put_contents("post.log", print_r($_POST, true));
    
    0 讨论(0)
提交回复
热议问题