33
Figure 13 Example Retrieving Arguments from the URL
4.5
DEVELOPING THE PAGE CONTENT
The user may customize the webpage to look however he/she likes by creating the entire HTML
content. Alternatively, the user can maintain the EM405-8 default look and feel of the webpage
by using the
l_em405web.lua
Lua library. This library contains a set of functions that can be
used to generate the main HTML structure that is used in the EM405-8’s default pages. By using
this library, the developer needs only to concentrate on the added content of the custom page.
The library l_em405web.lua includes four functions as summarized in Table IV. Details of each
function follow the table.
Table IV l_em405web.lua Library Functions
Function
Description
Top
Create the HTML header info and display the top banner
Bottom
Display the bottom banner & close the HTML
Contents_Pre
Setup a nested table including the navigation menu
Contents_Post
Close the nested table
print([[
<html>
<head>
<title>An HTML Page</title>
</head>
<body>
]])
for i=0, table.getn(arg) do
print(i,arg[i])
print("<br>")
end
print([[
</body>
</html>
]])
----------------------------------------------------------------
URL:
/cgi-bin/script.cgi?script=
myscript.lua
&arg1=val1&arg2=val2
Output:
0 myscript.lua
1 val1
2 val2