I'm using an ESP8266, to generate a webpage wtih a form,
after the form is submitted, I want to display another page,
saying for instance: "your data was submitted".
I've tried a coulpe of things:
sending a new html code to the web server I created after I get the data from the form with the handlers.
Doesn't work,
I also tried creating a new webServer after I get the data from the handlers, also not working
Can you help me with this?
String responseHTML = "<!DOCTYPE html>"
"<html lang=\"en\">"
"<head>"
"<meta charset=\"utf-8\">"
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"
"<title>CasaTemp</title>"
"</head>"
"<body bgcolor=\"#fafaeb\">"
" <center>"
"<font face=\"Lucida Console\" >"
"<br><br><br><br>"
"<form action=\"\" method=\"post\">"
"SSID: <input type=\"text\" name=\"SSID\"><br>"
"PASS: <input type=\"text\" name=\"Password\"><br>"
"NAME: <input type=\"text\" name=\"NAME\"><br>"
"MAIL: <input type=\"text\" name=\"MAIL\"><br>"
"<input type=\"submit\" value=\"Submit\">"
"</form>"
"<p><h1>Knowledge is Power!</h1></p>"
"</font>"
"</center>"
"</body>"
"</html>";
// configure access point
WiFi.mode(WIFI_AP);
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
WiFi.softAP("CasaTemp"); // WiFi name
webServer.onNotFound([]() { webServer.send(200, "text/html", responseHTML); });
webServer.begin();
char clientSSID [50];
char clientPASS[50];
char clientModulo_name[50];
char clientMail[50];
getClientSSID(clientSSID);
getClientPASS(clientPASS); These are the handler functions that get data from the form
getClientNAME(clientModulo_name);
getClientMAIL(clientMail);
Serial.println(clientSSID);
Serial.println(clientPASS);
Serial.println(clientModulo_name);
Serial.println(clientMail);
internet(SSID,PASS); This function simply connects the module to the internet