Note:
The GETGLOBALS module contains several functions to retrieve parameters, such as data transmitted by form, server variables, cookies, and so on.
available functions :
- ~getpost()
- ~getget()
- ~getconf()
- ~getfile()
- ~getserver() and ~getenvironment()
- ~getsession()
- ~getcookie()
~getpost()
Returns 'POST' variables. The only argument is the name of the variable to retrieve. 'POST' variables are often used with forms.Example :
~getget()
Returns 'GET' variables. The only argument is the name of the variable to retrieve. 'GET' variables are also often used with forms.~getconf()
Returns Templeet configuration variables. The only argument is the name of the variable to retrieve. Examples :~getconf('emailadmin') => ~getconf('snapshotid') => Templeet-2.0.0
~getfile()
Returns variables associated to files upload by form. The first argument is the name of the form field, the second may be : 'name', 'type', 'size', 'tmp_name'. This function works only with PHP4. Example :<form enctype="multipart/form-data" action="~relative_templeet_script()templeet_doc/getglobals.en.html" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="1000"> Send this file : <input name="userfile" type="file"> <input type="submit" value="Send File"> </form> ~getfile('userfile','name') => ~getfile('userfile','size') => ~getfile('userfile','type') => ~getfile('userfile','tmp_name') =>
~getserver() and ~getenvironment()
Return server variables. For a full list of those variables : here (or here for PHP in CGI mode)Example :
~getserver('HTTP_HOST') => rootix.free.fr ~getserver('REQUEST_URI') => /templeet_doc/getglobals.en.html ~getenvironment('TERM') => ~getenvironment('LANG') => fr_FR.UTF-8
~getsession()
Warning : only works with PHP4!~getcookie()
This function enables to retrieve a cookie stored on the client computer. The only argument is the name of the cookie. It returns the value associated to this name.If a cookie named 'foobar' was created with : setcookie and set to the value 'pika'. ~getcookie('foobar') will return pika