HTML page data handling in nodeMCU
Posted: Wed Jul 05, 2017 1:07 pm
Hi,
I have a NodeMCU which I am using in the access point mode. I use this mode to host a html page with a webserver code I have written. In the html page, I basically use a form to take in home Wi-Fi credentials to use it when in station mode. The values in those fields get passed on (I have attached a screenshot showing the same). But, when I use the following code to use those values, I am not able to use any of it.
server.args() gives a value of 0 and the program doesn't enter this loop at all. What am I doing wrong and how can I correct that? Any help is much appreciated.
Thanks!
I have a NodeMCU which I am using in the access point mode. I use this mode to host a html page with a webserver code I have written. In the html page, I basically use a form to take in home Wi-Fi credentials to use it when in station mode. The values in those fields get passed on (I have attached a screenshot showing the same). But, when I use the following code to use those values, I am not able to use any of it.
Code: Select all
if (server.args() > 0 ) {
for ( uint8_t i = 0; i < server.args(); i++ ) {
if (server.argName(i) == "fname") {
// do something here with value from server.arg(i);
}
}
}
server.args() gives a value of 0 and the program doesn't enter this loop at all. What am I doing wrong and how can I correct that? Any help is much appreciated.
Thanks!