CI_Input::server()

server($index[, $xss_clean = NULL]) Parameters: $index (mixed) – Value name $xss_clean (bool) – Whether to apply XSS filtering Returns: $_SERVER item value if found, NULL if not Return type: mixed This method is identical to the post(), get() and cookie() methods, only it fetches server data ($_SERVER): $this->input->server('some_data'); To return an array of multiple $_SERVER values, pass all the required keys as an array. $this->input->server(array('SERVER_PROTOCOL',

CI_Input::set_cookie()

set_cookie($name = ''[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = FALSE[, $httponly = FALSE]]]]]]]) Parameters: $name (mixed) – Cookie name or an array of parameters $value (string) – Cookie value $expire (int) – Cookie expiration time in seconds $domain (string) – Cookie domain $path (string) – Cookie path $prefix (string) – Cookie name prefix $secure (bool) – Whether to only transfer the cookie through HTTPS $httponly (bool) – Whether to on

CI_Input::valid_ip()

valid_ip($ip[, $which = '']) Parameters: $ip (string) – IP address $which (string) – IP protocol (‘ipv4’ or ‘ipv6’) Returns: TRUE if the address is valid, FALSE if not Return type: bool Takes an IP address as input and returns TRUE or FALSE (boolean) depending on whether it is valid or not. Note The $this->input->ip_address() method above automatically validates the IP address. if ( ! $this->input->valid_ip($ip)) { echo 'Not Valid'; } else { echo 'Vali

CI_Input::request_headers()

request_headers([$xss_clean = FALSE]) Parameters: $xss_clean (bool) – Whether to apply XSS filtering Returns: An array of HTTP request headers Return type: array Returns an array of HTTP request headers. Useful if running in a non-Apache environment where apache_request_headers() will not be supported. $headers = $this->input->request_headers();

CI_Input::post_get()

post_get($index[, $xss_clean = NULL]) Parameters: $index (string) – POST/GET parameter name $xss_clean (bool) – Whether to apply XSS filtering Returns: POST/GET value if found, NULL if not Return type: mixed This method works pretty much the same way as post() and get(), only combined. It will search through both POST and GET streams for data, looking in POST first, and then in GET: $this->input->post_get('some_data', TRUE);

CI_Input::user_agent()

user_agent([$xss_clean = NULL]) Returns: User agent string or NULL if not set Parameters: $xss_clean (bool) – Whether to apply XSS filtering Return type: mixed Returns the user agent string (web browser) being used by the current user, or NULL if it’s not available. echo $this->input->user_agent(); See the User Agent Class for methods which extract information from the user agent string.

CI_Input::get_request_header()

get_request_header($index[, $xss_clean = FALSE]) Parameters: $index (string) – HTTP request header name $xss_clean (bool) – Whether to apply XSS filtering Returns: An HTTP request header or NULL if not found Return type: string Returns a single member of the request headers array or NULL if the searched header is not found. $this->input->get_request_header('some-header', TRUE);

CI_Input::ip_address()

ip_address() Returns: Visitor’s IP address or ‘0.0.0.0’ if not valid Return type: string Returns the IP address for the current user. If the IP address is not valid, the method will return ‘0.0.0.0’: echo $this->input->ip_address(); Important This method takes into account the $config['proxy_ips'] setting and will return the reported HTTP_X_FORWARDED_FOR, HTTP_CLIENT_IP, HTTP_X_CLIENT_IP or HTTP_X_CLUSTER_CLIENT_IP address for the allowed IP addresses.

CI_Input::post()

post([$index = NULL[, $xss_clean = NULL]]) Parameters: $index (mixed) – POST parameter name $xss_clean (bool) – Whether to apply XSS filtering Returns: $_POST if no parameters supplied, otherwise the POST value if found or NULL if not Return type: mixed The first parameter will contain the name of the POST item you are looking for: $this->input->post('some_data'); The method returns NULL if the item you are attempting to retrieve does not exist. The second optional parameter

CI_Input::input_stream()

input_stream([$index = NULL[, $xss_clean = NULL]]) Parameters: $index (mixed) – Key name $xss_clean (bool) – Whether to apply XSS filtering Returns: Input stream array if no parameters supplied, otherwise the specified value if found or NULL if not Return type: mixed This method is identical to get(), post() and cookie(), only it fetches the php://input stream data.