Mon parser regexp pour récupérer les arguments de mes requêtes GET dans wifi_set_conf.html ne fonctionne pas :-(

This commit is contained in:
Christian Zufferey
2019-11-24 23:41:30 +01:00
parent 86106f561e
commit 9d5d3722cc
5 changed files with 102 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
# Quelques commandes remote (luatool) à envoyer avec le plugin Atom-IDE-terminal de l'éditeur Atom
# zf191124.1644
# zf191124.2340
# si luatool ne marche pas sur le MAC, il faut lire ceci:
# https://docs.google.com/document/d/1q64uK3IMOgEDdKaIAttbYuFt4GuLQ06k3FLeyfCsWLg/edit#heading=h.bmefcu67uwj0
@@ -67,6 +67,12 @@ zsort_rssi() zshow()
./luatool.py --ip $zIP:$zport -f b.lua
./luatool.py --ip $zIP:$zport -f web_srv2.lua
./luatool.py --ip $zIP:$zport -f z_index.html
./luatool.py --ip $zIP:$zport -f wifi_get_conf.html
./luatool.py --ip $zIP:$zport -f wifi_set_conf.html
./luatool.py --ip $zIP:$zport -f z_page1.html
./luatool.py --ip $zIP:$zport -f z_page2.html
./luatool.py --ip $zIP:$zport -f z_page3.html
@@ -77,6 +83,7 @@ zsort_rssi() zshow()
./luatool.py --ip $zIP:$zport --delete wifi_cli_start.lua
./luatool.py --ip $zIP:$zport --delete dir.lua
./luatool.py --ip $zIP:$zport --delete initz.lua
./luatool.py --ip $zIP:$zport --delete wifi_conf.lua

View File

@@ -1,26 +0,0 @@
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
<title>WIFI config</title>
</head>
<body>
<h1>WIFI config 191124.2229</h1>
<br>
Coucou c'est WIFI config !<br>
<a href="/">Retour à la home page...</a><br><br><br>
La température est:
<%
ztemp=ztemp+1
zout(ztemp.."°C")
%>
<br>Mais il fait encore trop froid !<br>
</body>
</html>

View File

@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
<title>WIFI get config</title>
</head>
<body>
<h1>WIFI get config 191124.2333</h1>
<br>
Coucou c'est WIFI get config !<br>
<a href="/">Retour à la home page...</a><br><br><br>
<form action="wifi_set_conf.html" method="get">
<table>
<tr>
<td>AP:</td>
<td><input type="text" name="zssid"></td>
</tr>
<tr>
<td>PASSWD:</td>
<td><input type="text" name="zpasswd"></td>
</tr>
<tr>
<td>Entrer YES:</td>
<td><input type="text" name="zverif"></td>
</tr>
</table>
<input type="submit" value="Ok">
</form>
<br>
<%
ztemp=ztemp+1
zout(ztemp.."°C")
%>
<br>Mais il fait encore trop froid !<br>
</body>
</html>

View File

@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
<title>WIFI set config</title>
</head>
<body>
<h1>WIFI set config 191124.2334</h1>
<br>
Coucou c'est WIFI set config !<br>
<a href="/">Retour à la home page...</a><br><br><br>
<%
if (vars ~= nil) then
zout("<br>vars: "..vars.."<br><br>")
for k, v in string.gmatch(vars, "(%w+)=(%w+%p+%w+)&*") do
_GET[k] = v
zout(k..": "..v.."<br>")
end
end
zout("<br>toto<br>")
--[[
zout("t1: ",_GET.zssid,"<br>")
zout("t2: ",_GET.zpasswd,"<br>")
if zverif == "YES" then
zout("c'est tout bon")
zout("Le SSID est: ",zssid)
zout("Le PASSWD est: ",zpasswd)
end
]]
ztemp=ztemp+1
zout(ztemp.."°C")
%>
<br>Mais il fait encore trop froid !<br>
</body>
</html>

View File

@@ -7,7 +7,7 @@
</head>
<body>
<h1>ESP8266 home page 191124.2228</h1>
<h1>ESP8266 home page 191124.2332</h1>
<h2>Différentes pages HTML:</h2>
<h3>
<a href="z_page1.html">Page 1, affichage de la température dynamique en code Lua inline.</a><br>
@@ -16,7 +16,7 @@
<a href="z_page4.html?field1=11&field2=12&field3=13">Page 4, test de récupération d'arguments pour un web service.</a><br>
<a href="api_hub_temp.html?field1=11&field2=12&field3=13">API HUB Temp,test d'un web service hub de mesures de température.</a><br>
<a href="disp_temp.html">Affichage des températures, affiche les températures mesurées.</a><br>
<a href="wifi_config.html">WIFI configuration.</a><br>
<a href="wifi_get_conf.html">WIFI configuration.</a><br>
<br><a href="page_qui_existe_pag.html">Page qui n'existe pas !</a><br>
</h3>