Input

The Input class provides functions for fetching input data and pre-processing it.

Security Filtering

This class is called automatically on every request and it does the following:

  • Removes slashes added by magic quotes
  • Standardizes newline characters to \n

postCount

Return total number of input elements submitted via POST.

input::postCount();

get

Get item in the $_GET array.

input::get('id');
input::get('id', 10); // return 10 if 'id' doesn't exist

post

Get item in the $_POST array.

input::post('name');
input::post('name', 'guest'); // return 'guest' if 'name' doesn't exist

get_post

Get item in the $_GET or $_POST array (in this order).

input::get_post('id');
input::get_post('id', 10); // return 10 if 'id' doesn't exist

post_get

Get item in the $_POST or $_GET array (in this order).

input::post_get('id');
input::post_get('id', 10); // return 10 if 'id' doesn't exist

files

Get file data in the $_FILES array.

input::files('image');
input::files('image', 'name'); // return 'name' item from the 'image' file array

server

Get item in the $_SERVER array.

input::server('HTTP_HOST');

protocol

Return "http" or "https" protocol.

input::protocol();

ssl

Return "true" if SSL connection is being used.

input::ssl();

referrer

Get referred.

input::referrer();

useragent

Get user's browser agent name.

input::useragent();

ipaddress

Get user's IP address.

input::ipaddress();

validateIP

Return true if IP address is valid.

input::validateIP('22.65.156.21');

isAjaxRequest

Return true if this is a ajax based request.

input::isAjaxRequest();

isCP

Return true is user is in the control panel.

input::isCP();