Country Detect & Redirect
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)
Ensure the security of your website with our professional SSL fixing service.
Start from $5 USDGet your WordPress website set up and deployed with ease.
Start from $7 USDCustom Laravel development tailored to your business needs.
Start from $500 USDComplete WordPress website development with themes and plugins.
Start from $100 USDBuild your online store with custom e-commerce solutions.
Start from $700 USDKeep your website updated and running smoothly with our maintenance services.
Start from $30 USD/monthImprove your website's visibility and search engine rankings with our SEO services.
Start from $150 USDHi, I'm Tarun, a Full-Stack Developer and Ethical Hacker with over 4 years of experience. I specialize in TOR network services, web development, and cybersecurity.
View My Upwork Profile