[luci] luci.http.header don't works

Lay András andras at lay.hu
Tue Apr 24 19:41:32 CEST 2012


Hello!

On Tue, Apr 24, 2012 at 4:58 PM, Bryan Mayland <bmayland at leoninedev.com> wrote:

> The problem is that you're just running a CGI script, not a LuCI response
> handler so you can't use luci http (because there's no context, LuCI isn't
> even involved).  To make a CGI page spit out the right content type:
>
> #!/usr/bin/lua
>
> print("Content-Type: text/html")
> print("")  ' header needs to be separated from content by a blank line
> print("<b>I am html content</b>")

Thank you, it works fine! I don't belive, this is the solution...

I mean, my another problem is similar. I can't read the get and post
data from a lua script:

-------------------------------------------------------------------------------------------------------

#!/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?

Lay


More information about the luci mailing list