This comment has been minimized.

edited

To add every new register instead of replacing the previous one, you must use FILE_APPEND with file_get_content.
$data . file_get_contents('php://input') . "\n*************************************************************\n", FILE_APPEND
Thank you.

This comment has been minimized.

I'm a complete newbie and maybe I can not even explain myself. However what I need is to save data coming from an http request to my server on a file. Thus it seems that the above script is perfect for my needs.
What I do not understand is where to put the script and how let it works: should I put the script on my server and use is URL in the http request to let him works and create the file?