<html> <body> <? get = parseGet(); --# Parse any GET data passed on to us. name = get['name'] or "unknown person"; x = (x or 0) + 1; --# Increment a persistent, global variable x. ? > <h1>Hello, <?=name?>!</h1> <?if (x > 3) then?> X is > 3! <?end?> </body></html>
純Lua腳本:
setContentType("text/html"); local vars = parseGet(); local user = vars["name"] or "unknown person"; print("Hello, ", user);