We have shown how to use the ESP8266 to collect sensor data, and send it to a database (client mode), but you can also use the ESP8266 as a webserver, displaying a web page and showing status or accepting input (server mode). In fact, it can be a server and a client at the same time. The following code runs a webserver on the esp8266, providing input fields to instruct the esp8266 to perform an action, and then POSTs that set of actions to the database. You could also read a sensor to verify that the actions were actually performed.