Good afternoon everyone!
I'm developing a project that consists of communicating a SIM900 module with an application, and making the interaction of the two will be a WEB server + database.
The APP, Database and PHP page items are already working perfectly.
PROBLEM: I am having trouble communicating the SIM900 module by POST method with the page that will "ADD" the information in the MySQL database.
I was able to add the information in the Database using the GET method (via URL)
AT+SAPBR=1,1
AT+HTTPINIT
AT+HTTPPARA="URL","site/add.php?variável1=xx&Variavel2=xx&Variavel3=xx"
AT+HTTPACTION=0
But for security reasons I have to use the POST method, and there's the problem ... When I try to send the data in any way by arduino + sim900 (AT + HTTPDATA, AT + CIPSEND or some other), simply "empty" information for me arrives on the site and consequently "empty" values are added in the Database as in the image below:
CurrentPHPpagecodeforADD.phpintheDatabase:
include("connect.php");
$link=Connection();
$Bateria=$_POST["Bateria"];
$Odometro=$_POST["Odometro"];
$Consumo=$_POST["Consumo"];
$Carro_Padrao=$_POST["Carro_Padrao"];
$query = "INSERT INTO 'u984057597_app'.'SMS_Recebidos'('timeStamp','Bateria','Odometro','Consumo','Carro_Padrao') VALUES (DATE_SUB(now(), INTERVAL 3 HOUR),'".$Bateria."','".$Odometro."','".$Consumo."','".$Carro_Padrao."')";
mysql_query($query,$link);
mysql_close($link);
Has anyone ever had this same problem and managed to solve it? do you need any more commands on the add.php page? (it gets the arduino data)
Thank you all right away!