Module cgilua.urlcode
Utility functions for encoding/decoding of URLs.
Info:
- Release: $Id: urlcode.lua,v 1.10 2008/01/21 16:11:32 carregal Exp $
Functions
| unescape (str) | Decode an URL-encoded string (see RFC 2396) |
| escape (str) | URL-encode a string (see RFC 2396) |
| insertfield (args, name, value) | Insert a (name=value) pair into table [[args]] |
| parsequery (query, args) | Parse url-encoded request data (the query part of the script URL or url-encoded post data) |
| encodetable (args) | URL-encode the elements of a table creating a string to be used in a URL for passing data/parameters to another script |
Functions
- unescape (str)
-
Decode an URL-encoded string (see RFC 2396)
Parameters:
- str
- escape (str)
-
URL-encode a string (see RFC 2396)
Parameters:
- str
- insertfield (args, name, value)
-
Insert a (name=value) pair into table [[args]]
Parameters:
- args Table to receive the result.
- name Key for the table.
- value Value for the key. Multi-valued names will be represented as tables with numerical indexes (in the order they came).
- parsequery (query, args)
-
Parse url-encoded request data
(the query part of the script URL or url-encoded post data) Each decoded (name=value) pair is inserted into table [[args]]
Parameters:
- query String to be parsed.
- args Table where to store the pairs.
- encodetable (args)
-
URL-encode the elements of a table creating a string to be used in a
URL for passing data/parameters to another script
Parameters:
- args Table where to extract the pairs (name=value).
Returns:
-
String with the resulting encoding.