1. 代码
#include "esp_http_server.h"
#include "esp_log.h"
#include "web_server.h"
#define MIN(a, b) ((a) < (b) ? (a) : (b))
static const char *TAG = "wifi web_server";
const char login_page[] = {
"\
<!DOCTYPE html>\
<html>\
<head>\
<meta charset='UTF-8'>\
<title>Sensor Configuration</title>\
</head>\
<body>\
<form method='POST' action='login.html'>\
<br>\
<P align=center style='color:#0066ff'><b>Sensor</b></P>\
<br><br>\
<P align=center>登录密码:    <input name=PASSWORD type=password size=18 maxlength=15></P>\
<br>\
<P align=center><input type=submit value='进入'></P>\
</form>\
</body>\
</html>\
"};
const char str_password_ok[] = "Password validated successfully";
const char str_password_ng[] = "Invalid password";
const char str_password_lost[] = "Missing PASSWORD field";
esp_err_t http_get_handler(httpd_req_t *req)
{
const char* resp_str = login_page;