test_main.lp 564 B

12345678910111213141516171819202122232425262728293031
  1. <html>
  2. <head><title>Embeded Lua Test</title></head>
  3. <body>
  4. cgi = {
  5. <?lua
  6. for i,v in pairs (cgi) do
  7. if type(v) == "table" then
  8. local vv = "{"
  9. for a,b in pairs(v) do
  10. vv = string.format ("%s%s = %s<br>\n", vv, a, tostring(b))
  11. end
  12. v = vv.."}"
  13. end
  14. ?>
  15. <%= i %> = <%= tostring(v) %> <br>
  16. <%
  17. end
  18. %>
  19. }
  20. <br>
  21. Remote address: <%= cgilua.servervariable"REMOTE_ADDR" %>
  22. <br>
  23. Is persistent = <%= tostring (SAPI.Info.ispersistent) %>
  24. <br>
  25. ap = <?lua= tostring(ap) ?> <br>
  26. lfcgi = <% = tostring(lfcgi) %> <br>
  27. <%= (ap and ap.handler()) or "" %> <br>
  28. </body>
  29. </html>