Logging a http post by a PHP script
I need somebody to help me to capture the http post coming to a PHP script.
For example I will host this script at my website : http://mydom.com/http_analyser.php
When I post a data like this http://mydom.com/http_analyser.php?u...this+is+a+test
I want to log this data to a log / txt file.
The method you have isn't a post, its a get.
Regardless of the method, you simply retrieve the values from the corresponding $_GET or $_POST superglobal, and then write to a file. You can use file_put_contents with the FILE_APPEND as the third argument to write the line you want. The documentation does not specify, but the examples do indicate that you will need to manually add the \n (just use PHP_EOL for it so you don't have to worry about the OS).
|All times are GMT +1. The time now is 06:55 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.