Reputation: 2859
What is equalient of $_SERVER in codeigniter ?
Upvotes: 7
Views: 17157
Reputation: 3322
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
The three functions are:
$this->input->post()
$this->input->cookie()
$this->input->server()
Upvotes: 3
Reputation:
I think you can use $_SERVER like they did about the "Automatic configbase url" in the "official" CodeIgniter wiki (http://codeigniter.com/wiki/Automatic_configbase_url/)
Upvotes: 2
Reputation: 30766
Réjôme is spot on, but remember that $_SERVER still works fine.
Upvotes: 8
Reputation: 1484
$this->input->server()
For more information, please refer to the User Guide : Input
Upvotes: 27