Categories
Snaps
Search
Register
Contact
API
IP Address of visitor's connection
Returns the IP address of the visitor's connection.
//Return the visitor's IP address function get_ip(){ if (isset($_SERVER["REMOTE_ADDR"])) { $ip=$_SERVER["REMOTE_ADDR"] . ' '; } else if ( isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ) { $ip=$_SERVER["HTTP_X_FORWARDED_FOR"] . ' '; } else if ( isset($_SERVER["HTTP_CLIENT_IP"]) ) { $ip=$_SERVER["HTTP_CLIENT_IP"] . ' '; } return $ip; }
Usage
Comments
Add your comment
Search
Coder: JoeByrne
View more snaps from JoeByrne
View JoeByrne's profile
Rate this snap
Rating:
0
/ 5 (
0
votes) 1029 views
Custom class generator
Selected snaps:
None selected yet.
Hot PHP snaps
PHP image slideshow auto
PHP pagination class
Bootstrap PHP code
Clean URL
PHP ffmpeg Upload Script
Rijndael 256 bit encryption using mcrypt
generate a preview image from an FLV file on-the-fly, or to save
Median calculator
Partners
PHP Site
PHPSnips
Comments