Chat freely about anything...

User avatar
By Ian Phill
#56259 Hi. I have a local page in localhost/a.php
<html>
<body>
<input type="text" name="dp">
</body>
</html>

I wanna get the value in "dp" with my ESP8266 module, that is possible?

Thank you in advance. I appreciate it your help

This is my code:
//=======================================
#include <ESP8266WiFi.h>

const char* ssid = "user";
const char* pass = "passwd";

WiFiClient client;

void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Connecting...");
WiFi.begin(ssid,pass);

while(WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
}

Serial.print("Connected to: ");
Serial.println(ssid);
Serial.print("IP: ");
Serial.println(WiFi.localIP());
}

void loop() {
// put your main code here, to run repeatedly:
if(client.connect("10.0.0.8/a.php",80) > 0) { //doesn't work
Serial.println("Connected with 10.0.0.8");
}
else {
Serial.print("Connection Error");
}
delay(1000);
}
User avatar
By martinayotte
#56274 I think you need to study how HTML works a bit more... :ugeek:
To get values of input fields, you need to have those <INPUT> fields inside a <FORM> with "action" POST URL along with a Submit button
User avatar
By rudy
#56297 I agree. It sucks that you need to know so much to get what you want. It has been a struggle for me but if you want to do this kind of thing then you need to put in the time learning all the pieces.
User avatar
By mrburnette
#56300
rudy wrote:I agree. It sucks that you need to know so much to get what you want. It has been a struggle for me but if you want to do this kind of thing then you need to put in the time learning all the pieces.



There is however numerous good sources for self-education. For example here.

The ESP8266 is a significant game-changer over the Arduino Ethernet or WiFi card ... primarily in affordability... $4 puts the ESP8266 into a completely low-end price category but with large capabilities.

Ray