how to re-configure the Access point and password of esp8266?


Now, I am able to configure the AP(access point) name and password but I need to store these two in esp flash memory so that user can give any AP and password for their comfortable.

So, my question is How to re- configure or set the AP and password by the user manually?
How to store in to flash memory ? what is memory pattern to store? please provide me code if available .

Module: ESP8266EX
IDE : Arduino

Thank you



This library provides a good solution to this common problem:

The ESP8266 is set up as an AP. The user connects to that AP via any WiFi device and opens a web browser. The web browser automatically displays a configuration page that they can use to set the SSID and password of the router they want the ESP8266 to connect to. The library also allows to to add custom forms to that page in case there are other configuration parameters for your particular application.