Lua & Lighttpd
What's Lua's equivalent to php's $_GET
for a web application?
Also if the url is something like index.cgi?thisisatest
how can I get everything after the question mark?
In the context of lighttpd and mod_magnet, query strings are not parsed automatically so you need to do it yourself. You can find an example here, look for "flv-streaming.lua" in the page.
As for your second question, Lorenzo gave you a generic answer, but in mod_magnet you can also use lighty.env["uri.query"]
as seen in the same example.
Lua in itself is not a language for web development. There are some libraries for that. You can try luasocket.
As for your second question:
local url = "index.cgi?thisisatest"
local suffix = string.match( url, "^[^?]+?([^?]-)$" )
print( suffix )
如果你在Ophal中运行你的Lua代码,那么你可以使用函数:request_uri()和request_path()
链接地址: http://www.djcxy.com/p/60704.html上一篇: POST和$
下一篇: Lua&Lighttpd