client.print(String("POST ") + url +
" HTTP/1.1\r\n" + "Host: " +
host + "\r\n" + "User-Agent: Arduino/1.0\r\n" + "Cache-Control: no-cache\r\n" +
"Content-Type: application/x-www-form-urlencoded" + "\r\n" + "Connection: close\r\n\r\n" +
"Content-Length: " + post.length() + "\r\n" + post );
The post data is like this.
String post = "number=1&status=OFF";
I'm using XAMPP to host the webpage. Everything seems to work fine but after execution what i receive is this on the php page.
Notice: Undefined index: number in C:\xampp\htdocs\pumpupdate.php on line 3
Notice: Undefined index: status in C:\xampp\htdocs\pumpupdate.php on line 4
which means the the $_GET commands in the php script don't reveive the variables sent to the page's URL. When i tried manually updating the url it worked fine, which i concluded as the php file working properly.
Please advice. really appreciate the help. Thanks.