local globle = require "cgilua.globle"
function pt (tab)
if (not tab) then
return
end
for i, v in pairs (tab) do
local vv = v
if type(v) == "table" then
vv = ""
for _i, _v in pairs (v) do
vv = vv..string.format ("%s = %q, ", _i, _v)
end
vv = '{'..vv..'}'
end
cgilua.put (string.format ("%s = %s
\n", tostring (i), tostring (vv)))
end
end
cgilua.htmlheader()
if globle then
if cgi.field then
local save = {}
save.field=cgi.field
globle.set("field",save)
else
pt(globle.get("field"))
end
cgilua.put "cgiext.globle.data = {
\n"
pt (globle.get("field"))
cgilua.put "}
\n"
cgilua.put [[