mikshaw
Group: Members
Posts: 4856
Joined: July 2004 |
|
Posted: April 01 2008,16:51 |
|
It's an environment variable
Try os.getenv("QUERY_STRING")
Here's an example I have in one of my in-progress cgi scripts
Code Sample | -- break up query string params=" "..string.gsub(os.getenv("QUERY_STRING"),"&"," ").." "
function get_param(var) local p=string.gsub(params,".*"..var.."=(.-)%s.*","%1") -- strip any naughty leading path p=string.gsub(p,".*/","") return(p) end
var_a=get_param("one") var_b=get_param("two")
|
This particular function breaks up a string that uses the format myscript.cgi?one=something&two=somethingelse The lua script would end up setting var_a="something" and var_b="somethingelse"
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|