webmcp

diff framework/env/param/get_all_cgi.lua @ 0:9fdfb27f8e67

Version 1.0.0
author jbe/bsw
date Sun Oct 25 12:00:00 2009 +0100 (2009-10-25)
parents
children 2f8d8edd1836
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/framework/env/param/get_all_cgi.lua	Sun Oct 25 12:00:00 2009 +0100
     1.3 @@ -0,0 +1,20 @@
     1.4 +--[[--
     1.5 +params =         -- table with all non-list parameters
     1.6 +param.get_all_cgi()
     1.7 +
     1.8 +This function returns a table with all non-list GET/POST parameters (except internal parameters like "_webmcp_id").
     1.9 +
    1.10 +--]]--
    1.11 +
    1.12 +function param.get_all_cgi()
    1.13 +  local result = {}
    1.14 +  for key, value in pairs(cgi.params) do  -- TODO: exchanged params too?
    1.15 +    if
    1.16 +      (not string.match(key, "^_webmcp_")) and
    1.17 +      (not string.match(key, "%[%]$"))
    1.18 +    then
    1.19 +      result[key] = value
    1.20 +    end
    1.21 +  end
    1.22 +  return result
    1.23 +end

Impressum / About Us