PHP Classes
elePHPant
Icontem

PHP Cloudflare IP GEO: Get the IP of a user of a site that uses Cloudfare

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-06-25 (23 hours ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
cfgeo 1.0GNU General Publi...5.6Networking, PHP 5, Geography
Description Author

This class can get the IP of a user of a site that uses Cloudfare.

It takes the current user IP address from the HTTP headers that were sent to the server.

If the current site accesses are handled by Cloudflare, it checks specific headers set by Cloudflare servers that pass the current user computer IP address as well the two letter code of the country associated to that IP address.

The class can also return the name of the country associated to the current user country code.

Name: Meraj-Ul Islam <contact>
Classes: 2 packages by
Country: Bangladesh Bangladesh

Details
There are three functions available in this class. Call them individually along with the class.
To get ip address from cloudflare, call: getClientIp()
To get country code from cloudflare, call: getCountryCode()
To get country from cloudflare, call: getCountryName()
  Files folder image Files  
File Role Description
Plain text file class.cfgeo.php Class The main class
Accessible without login Plain text file example.php Example Example usage of the class
Accessible without login Plain text file readme.txt Doc. The documentation file

 Version Control Unique User Downloads  
 0%
Total:0
This week:0