Created
August 31, 2011 23:56
-
-
Save kenjis/1185079 to your computer and use it in GitHub Desktop.
CodeIgniter contoller which shows client IP address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Ip_address extends CI_Controller { | |
function __construct() | |
{ | |
parent::__construct(); | |
} | |
function index() | |
{ | |
//var_dump($_SERVER); | |
echo $this->input->ip_address(); | |
} | |
} | |
/* End of file ip_address.php */ | |
/* Location: ./application/controllers/ip_address.php */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, it works!