problem with POST sent from microcontroller to web server PHP

maybe writing all the data inside $_POST to a txt file?

Yes. When I was doing PHP development, I created a library of useful functions. One of them was:

function PrintPostVars($caller)
{
	$received = "Post vars\r\n\r\n";
	
	foreach($_POST as $key=>$value)
	{
		$received .= "$key = [$value]\r\n";
	}
	
	$printout = fopen("C:\\tmp\\post_variables.txt",'a');
	fwrite($printout, "Number of post variables in $caller: ");
	fwrite($printout, count($_POST));
	fwrite($printout, "\r\n");
	fwrite($printout, $received);
	fwrite($printout, "\r\n");
	fclose($printout);
}

Then, in the php script, I could put:

	require_once 'library/functions.php';
//	PrintPostVars();

Uncomment the function call to write the data to the file.