PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
  Classes of Meraj-Ul Islam  >  PHP Cloudflare IP GEO  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example usage of the class
Class: PHP Cloudflare IP GEO
Get the IP of a user of a site that uses Cloudfare
Author: By
Last change:
Date: 4 months ago
Size: 388 bytes
 

 

Contents

Class file image Download
<?php
// require the class
require_once('class.cfgeo.php');

// initialize the class
$cf = new cfGeo;

// get user's IP
echo 'IP: '.$cf->getClientIp().'<br>';

// get user's county code in ISO format
echo 'Country Code: '.$cf->getCountryCode().'<br>';

// get user's country name
echo 'Country Name: '.$cf->getCountryName().'<br>';

/* Your site need to be intergrated to cloudflare */
?>