CoreAPI
[ class tree: CoreAPI ] [ index: CoreAPI ] [ all elements ]

Procedural File: gpc_api.php

Source Location: /core/gpc_api.php



Page Details:



Tags:

copyright:  Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
copyright:  Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
link:  http://www.mantisbt.org
usedby:  session_api.php
usedby:  collapse_api.php





bool $g_cookie_httponly_flag_enabled [line 39]

Determines (once-off) whether the version of PHP executing this script has support for the HttpOnly cookie flag. If so, we will set this flag to true so that it'll be added to all cookies sent to the client.

Default value:   version_compare( PHP_VERSION, '5.2.0', '>=' )


[ Top ]



bool $g_cookie_secure_flag_enabled [line 31]

Determines (once-off) whether the client is accessing this script via a secure connection. If they are, we want to use the Secure cookie flag to prevent the cookie from being transmitted to other domains.

Default value:   isset( $_SERVER['HTTPS'] ) && ( utf8_strtolower( $_SERVER['HTTPS'] ) != 'off' )


[ Top ]






gpc_clear_cookie [line 384]

bool gpc_clear_cookie( string $p_name, [string $p_path = null], [string $p_domain = null])

Clear a cookie variable



Parameters

string   $p_name  
string   $p_path  
string   $p_domain  
[ Top ]



gpc_get [line 55]

null gpc_get( string $p_var_name, [ $p_default = null])

GET, POST, and Cookie API --------------- Retrieve a GPC variable.

If the variable is not set, the default is returned. If magic_quotes_gpc is on, slashes will be stripped from the value before being returned.

You may pass in any variable as a default (including null) but if you pass in *no* default then an error will be triggered if the field cannot be found




Parameters

string   $p_var_name  
   $p_default  
[ Top ]



gpc_get_bool [line 146]

bool|null gpc_get_bool( string $p_var_name, [bool $p_default = false])

Retrieve a boolean GPC variable. Uses gpc_get().

If you pass in *no* default, false will be used




Parameters

string   $p_var_name  
bool   $p_default   (optional)
[ Top ]



gpc_get_bool_array [line 292]

array gpc_get_bool_array( string $p_var_name, [string $p_default = null])

Retrieve a boolean array GPC variable. Uses gpc_get().

If you pass in *no* default, an error will be triggered if the variable does not exist.




Parameters

string   $p_var_name  
string   $p_default  
[ Top ]



gpc_get_cookie [line 319]

string gpc_get_cookie( string $p_var_name, [string $p_default = null])

Retrieve a cookie variable

You may pass in any variable as a default (including null) but if you pass in *no* default then an error will be triggered if the cookie cannot be found




Parameters

string   $p_var_name  
string   $p_default  
[ Top ]



gpc_get_custom_field [line 200]

string gpc_get_custom_field( string $p_var_name, $p_custom_field_type, [mixed $p_default = null], int $p_custom_field_Type)

Retrieve a custom field variable. Uses gpc_get().

If you pass in *no* default, an error will be triggered if the variable does not exist




Parameters

string   $p_var_name  
int   $p_custom_field_Type  
mixed   $p_default  
   $p_custom_field_type  
[ Top ]



gpc_get_file [line 413]

mixed gpc_get_file( string $p_var_name, [ $p_default = null], mixed $p_file)

Retrieve a file variable

You may pass in any variable as a default (including null) but if you pass in *no* default then an error will be triggered if the file cannot be found




Parameters

string   $p_var_name  
mixed   $p_file  
   $p_default  
[ Top ]



gpc_get_int [line 120]

int|null gpc_get_int( string $p_var_name, [int $p_default = null])

Retrieve an integer GPC variable. Uses gpc_get().

If you pass in *no* default, an error will be triggered if the variable does not exist




Parameters

string   $p_var_name  
int   $p_default   (optional)
[ Top ]



gpc_get_int_array [line 265]

array gpc_get_int_array( string $p_var_name, [array $p_default = null])

Retrieve an integer array GPC variable. Uses gpc_get().

If you pass in *no* default, an error will be triggered if the variable does not exist




Parameters

string   $p_var_name  
array   $p_default  
[ Top ]



gpc_get_string [line 97]

string|null gpc_get_string( string $p_var_name, [string $p_default = null])

Retrieve a string GPC variable. Uses gpc_get().

If you pass in *no* default, an error will be triggered if the variable does not exist




Parameters

string   $p_var_name  
string   $p_default   (optional)
[ Top ]



gpc_get_string_array [line 242]

array gpc_get_string_array( string $p_var_name, [array $p_default = null])

Retrieve a string array GPC variable. Uses gpc_get().

If you pass in *no* default, an error will be triggered if the variable does not exist




Parameters

string   $p_var_name  
array   $p_default  
[ Top ]



gpc_isset [line 78]

bool gpc_isset( string $p_var_name)



Parameters

string   $p_var_name  
[ Top ]



gpc_isset_custom_field [line 167]

bool gpc_isset_custom_field( string $p_var_name, int $p_custom_field_type)

see if a custom field variable is set. Uses gpc_isset().



Parameters

string   $p_var_name  
int   $p_custom_field_type  
[ Top ]



gpc_make_array [line 436]

null gpc_make_array( string $p_var_name)

Convert a POST/GET parameter to an array if it is not already one.



Tags:

return:  no return value. The $_POST/$_GET are updated as appropriate.


Parameters

string   $p_var_name   - The name of the parameter
[ Top ]



gpc_set_cookie [line 352]

bool gpc_set_cookie( string $p_name, string $p_value, [bool $p_expire = false], [string $p_path = null], [string $p_domain = null], [bool $p_httponly = true])

Set a cookie variable If $p_expire is false instead of a number, the cookie will expire when the browser is closed; if it is true, the default time from the config file will be used.

If $p_path or $p_domain are omitted, defaults are used. Set $p_httponly to false if client-side Javascript needs to read/write the cookie. Otherwise it is safe to leave this value unspecified, as the default value is true.




Tags:

return:  - true on success, false on failure
todo:  this function is to be modified by Victor to add CRC... for now it just passes the parameters through to setcookie()


Parameters

string   $p_name  
string   $p_value  
bool   $p_expire   default false
string   $p_path   default null
string   $p_domain   default null
bool   $p_httponly   default true
[ Top ]



gpc_string_to_bool [line 455]

bool gpc_string_to_bool( string $p_string)

Convert a string to a bool



Parameters

string   $p_string  
[ Top ]



gpc_strip_slashes [line 468]

mixed gpc_strip_slashes( mixed $p_var)

Strip slashes if necessary (supports arrays)



Parameters

mixed   $p_var  
[ Top ]



Documentation generated on Sun, 12 Dec 2010 23:50:30 +0900 by phpDocumentor 1.4.3
inserted by FC2 system