Can't transmit right data Apache Server through ESP8266

i'm a new bie. I try to connect (POST) some data to Apache Server through ESP8266. I have read this topic: POST HTTP with AT Commands - Programming Questions - Arduino Forum and this video : ESP8266 Send Data To a Website (ESP-01/ESP-12) - YouTube

But when i send to ESP8266, have some errors. i cannot know why. :frowning:

This is my code at Server

<meta charset="utf-8"/>

<?php
if($_SERVER["REQUEST_METHOD"]=="POST"){
	
	if(!empty($_POST["tem"]){
		$tem =   $_POST["tem"];
		
		file_put_contents("data.txt",$tem,FILE_APPEND);
		echo "a = ".$tem;
	}else {
		echo "POst empty";
	}
	

}
?>

i have attached file of arduino .

Please help me!

send2server.ino (2.02 KB)

But when i send to ESP8266, have some errors.

And they are?

You are sending temp=35 as the POST data, and then looking for tem=something in the PHP script. Why?

PaulS:
And they are?

You are sending temp=35 as the POST data, and then looking for tem=something in the PHP script. Why?

yes!
I have 2 problems!

  1. Cannot display right font when ESP8266 return data from server. Sometimes, It's display some Unknown character "L(CÇäÿÿæc@ˆþ„@JSÀ€àà", and Errors...... I don't know why?

  2. Because I'm new bie. I don't know my arduino code is correct. Data are tranmited from Arduino to ESP8266 ..........right way. the same code but sometimes ESP8266 return error sometimes not.

With code get data from sever it's ok! but sometimes errors occur!