Skip to content

Best Deals For Everyone

Get The Best Online Deals

Country Detect & Redirect

Posted on November 11, 2022 By xacab No Comments on Country Detect & Redirect

LIVE PREVIEWBUY FOR $26

Country Detect & Redirect - 1 Country Detect & Redirect - 2 Country Detect & Redirect - 3 Country Detect & Redirect - 4

Class that lookup’s for a country code then it redirects (include files, or callbacks) the user to desired content you want.
The function of this class is like Google that redirects users from countries that support google
e.g. in UK when you enter google.com you will be redirected to google.co.uk and this is exactly
what you can do with CountryDetector

This class is builded in static context for purpose of best usage. Also it is very easy to implement

Table of Contents

  • Update: 21 Nov, 2012
  • Updated
  • Features
  • Requirements

Update: 21 Nov, 2012

We present you two new functions to simplify the work of handling country codes. These functions are:

CountryDetect::getCountryCode();

It returns the current country code of user in two (or three sometimes) uppercase initials.

The second CountryDetect function is “is($country_code)”, so you can easily check if its a specified country code in order to take an action.

CountryDetect::is($country_code);

It returns true or false, based on the condition of specified country code, which is case iNsEnSiTiVe.

Examples about usage of these functions are located on examples/7_get_country_code.php.

Updated

There is added another function called

includeFileOnce

for purposes when you want to include just once a file, and ignore other below declaration lines

Features

  • Country detect then redirect
  • Country detect then include a specific file
  • Country detect then call a function defined by you (callback)

Requirements

PHP 5

Country Detect & Redirect - 5


Source

PHP Scripts Tags:Country, Detect, Redirect

Post navigation

Previous Post: GamePort – Video Game Marketplace
Next Post: PHP FansOnly Patrons – Paid Content Creators Platform

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Lemon Grid – Responsive & Drag-drop Add-on VC
  • Caribbean Stud Poker – HTML5 Casino Game
  • sPlayer – Sticky Audio Player With Playlist
  • Stock Market & Financial News Headlines | WordPress Plugin
  • Easy WooCommerce Per Product Shipping

Copyright © 2023 Best Deals For Everyone.

Powered by PressBook WordPress theme