WorldWideScripts.net Delivering the best Add-Ons in more than 37 languages.

中文(简体), English, हिन्दी/हिंदी, Español/Castellano, العربية, Русский язык, Français, 中文 (台灣), বাংলা, Bahasa Indonesia, اردو, Português, Deutsch, Bahasa Melayu (بهاس ملايو‎), 日本語 (にほんご), فارسی, Italiano, తెలుగు, Türkçe, ગુજરાતી, Język polski/polszczyzna, Tiếng Việt, ಕನ್ನಡ, Українська мова, ไทย
PHP Scripts / Navigation

Country Detect & Redirect

— Add-On to WorldWideScripts.net

Subscribe to our feed to stay up to date!

New! Follow us as you want it!


Country Detect & Redirect - CodeCanyon Item for Sale

Ads

Ad: Bluehost hosting

DocumentationVideo ChanneGet Support


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

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


You may interested our creative theme Clear thinking the wrong moment can stifle creativity tdng O1tI Blog


Download
Other components in this categoryAll components of this author
CommentsFrequently asked questions and answers

Properties

Created:
26 February 10

Last Update:
N/A

High Resolution:
No

Compatible Browsers:
IE6, IE7, IE8, Opera

Files Included:
HTML, PHP

Software Version:
PHP 5.3

Keywords

eCommerce, eCommerce, All Items, country callback, country detector, country include file, country redirect