lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


hi there! :)


by default a form is pointing to the same path/file on a server if no
target is given and using get for default method, so u will get
/config.htm?param1=val1&param2=val2 from any browser if you opened
your stuff like /config.htm, however i think you should address
server.lua that will render you the page and gonna be able to process
the params...

so server side logic should handle these params in the same file
generally, however, it wont be the config.htm, cuz your server.lua
catches everything in your case and that renders the config.htm as
well, but i dunno how the access comes to your device...

the savex function in server.lua puts the given config into a file
called s.txt (its param is unused, however it can see the variable 's'
as an upvalue, so be careful, there can be other smaller-bigger
mistakes around, and its nearly seems to be an abandonware, or just
doing its business right, so none touched for a while. btw there are
some small updates in its forks, that doesnt seem to be like much
important changes)

i didnt go farer in the sources, but probably i could give you some
hints that you can follow. i'd try to change the s.txt first via the
form, and maybe you will need to call server.lua instead of
config.htm... however the readme seems to be fine and the webui is a
manager for your devices and the lua files are handling your devices -
if im right...

some good resources for you:
- official lua manual for whatever version you have at lua.org
- programming in lua book - the version available on lua.org is to
5.0, but the reference manual have a small chapter around its end for
the changes between versions
- lua-users.org - here you can find kinda much anything you can imagine
- your favorit search engine, cuz you can find kinda much everything
in the wild that you could miss :)
(and there are so much others, just these will be enough mostly)


(sorry for my lazy style)
i hope i could say anything helpful, have fun around, lua is the very
best language i ever knew :)