So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Abhilash R
#67947 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.
Code: Select allif (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!
You do not have the required permissions to view the files attached to this post.
User avatar
By QuickFix
#67982
martinayotte wrote:Without showing us the HTML code, it is hard to see where is your issue ...

Your crystal ball is away for maintenance again? :lol:
User avatar
By Abhilash R
#68016
martinayotte wrote:Without showing us the HTML code, it is hard to see where is your issue ...
Are you doing a FORM to POST your fields ?
Do you have a separate URL for the POST ?

Check this example to inspire you :
https://github.com/esp8266/Arduino/blob ... cation.ino


The HTML code for this is in my laptop at home. I will share the code when I get home from work. Thank you so much for the response. And, also for the link. I shall check that out.