summaryrefslogtreecommitdiff
path: root/test/webform.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/webform.lua')
-rw-r--r--test/webform.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/webform.lua b/test/webform.lua
new file mode 100644
index 00000000..3e4c3ce4
--- /dev/null
+++ b/test/webform.lua
@@ -0,0 +1,8 @@
+-- convert POST data to Lua table
+
+T=read"*a" -- for GET, use T=getenv"QUERY_STRING"
+T=gsub(T,"=","=[[")
+T=gsub(T,"&","]],\n")
+T=gsub(T,"+"," ")
+T=gsub(T,"%%(%x%x)",function (x) return strchar(tonumber(x,16)) end)
+write("form{\n",T,"]]}\n")