Go Down

Topic: esp8266 send data problem (Read 243 times) previous topic - next topic

atiker

hi friends,

i wish send data to my websites


action1
Code: [Select]

AT+CIPMUX=1


OK

AT+CWJAP="Kablonet_Netmaster-FAF6-G","mortMen20122111"

OK

AT+CIPSTART=0,"TCP","abc.com",80

0,CONNECT

OK
AT+CIPSEND=0,18

> GET /gir.php?devre=1 HTTP/1.0\r\n\r\n
busy s...

SEND OK





action2
Code: [Select]

AT+CIPMUX=1


OK

AT+CWJAP="Kablonet_Netmaster-FAF6-G","mortMen20122111"

OK

AT+CIPSTART=0,"TCP","abc.com",80

0,CONNECT

OK
AT+CIPSEND=0,18

> GET http://abc.com/gir.php?devre=1 HTTP/1.0\r\n\r\n
busy s...

SEND OK



gir.php
Code: [Select]

if (isset($_POST['devre'])) 
{
$gelenveri_deger=$_POST['devre'];

$kaydet=$db->prepare("INSERT INTO gelenveri set
gelenveri_deger=:gelenveri_deger
");

$insert=$kaydet->execute(array(
'gelenveri_deger'=>$gelenveri_deger
));

}



but mysql database is empty...how can i do it?

rw950431


You seem to be doing a "GET" from the ESP side but your PHP code expects a "POST".

try changing all the $_POST to $_GET in your php code and try again.


See https://www.php.net/manual/en/reserved.variables.get.php

Go Up