[luci] luci.http.header don't works
Bryan Mayland
bmayland at leoninedev.com
Tue Apr 24 19:56:10 CEST 2012
On 4/24/2012 1:41 PM, Lay András wrote:
> #!/usr/bin/lua
>
> require'luci.http'
>
> ertek=luci.http.formvalue('ertek')
>
> print(ertek)
>
> -------------------------------------------------------------------------------------------------------
>
> I call the script from browser xxx.lua?ertek=cucc, but nothing
> printed. How to do this?
Same issue again. You've got a CGI script, not a luci page handler,
which means that you can't use luci.http at all. If you want to make use
of the luci framework for http handling (which I suggest you do if your
project has any complexity) then you need to make a luci module. It is
quite easy and powerful.
http://luci.subsignal.org/trac/wiki/Documentation/ModulesHowTo
If you want to keep going the bare CGI script method, I recommend you
read up on how query parameters are passed to CGI scripts in general.
The answer is through environment variables, see RFC3875 section 4.1
"Request MetaVariables"
http://www.ietf.org/rfc/rfc3875
More information about the luci
mailing list