What is equalient of $_SERVER in codeigniter ?
Currently supported databases are: MySQL (5.1+) via the mysql (deprecated), mysqli and pdo drivers. Oracle via the oci8 and pdo drivers. PostgreSQL via the postgre and pdo drivers.
The request class is an object-oriented representation of an HTTP request. This is meant to work for both incoming, such as a request to the application from a browser, and outgoing requests, like would be used to send a request from the application to a third-party application.
$this->input->server()
For more information, please refer to the User Guide : Input
Réjôme is spot on, but remember that $_SERVER still works fine.
Use the codigniter "way" for input such as $_POST and $_SERVER. CodeIgniter's input class has built in functionality to prevent XSS attacks. Using the input class will also make your code much more extendable, if for example, you wish to build in some kind of intrusion systems, such as PHP IDS.
http://codeigniter.com/user_guide/libraries/input.html
http://www.phpids.org/
The three functions are:
$this->input->post()
$this->input->cookie()
$this->input->server()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With