अप्रेल 25 2019 04:13:37
Language Switcher
· Start/घर
· Downloads/डाउनलोड
· Faq/एफ.ए.क्यू
· Forum/चर्चा मंच
· Weblinks/वेब लिंक्स
· Rules/नियम
· Privacy/गोपनीयता नीतियाँ
· Contact/संपर्क करें
· Search/खोज करें
· Advance Fusion Search
बॉक्स चिल्लाऊँ
You must login to post a message.

25-01-2019 21:05
In lo dam hlawm maw?
View Thread
Who is here? 1 guest(s)
All MODs and their Supported Threads goes here in this Section.
 Print Thread

[MOD]Prevent certain countries to register

If you have a website aimed at only 1 country and receive a lot of spammers from other countries then you can prevent them registering with this mod.

Or just block unwanted countries.

In this example I use XX for the country codes so I cannot offend any countries by listing them here.
Replace XX for the desired country to block.

Open register.php and find around line 86
Download source  Code

   if (!preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $email)) {
      $error .= $locale['406']."<br />\n";

Insert directly below this code.
Download source  Code

// block unwanted countries. See Wipmania.com for country list. Mod by Wanabo.
if (getenv(HTTP_X_FORWARDED_FOR)) {$trueip = getenv(HTTP_X_FORWARDED_FOR);} else {$trueip = getenv(REMOTE_ADDR);}
$blockcountry = array("XX","XX","XX");
$country = file_get_contents("http://api.wipmania.com/".$trueip."?".$_SERVER['HTTP_HOST']."");
if ($country == in_array($country,$blockcountry)) {$error .= $locale['406']."<br />\n";}
// end country mod

Improvements of this code is welcome.
Thanks for this Good MOD Wanabo.... Wink

Also, you can Block them through the .htaccess if you want to Block particular IPs or IP Range from a particular Country !!! Smile
Be What you want to be...Wink
But in htaccess, you prevent them from viewing your site as well.
Besides ip ranges change now and then, wipmania.com keeps them updated for you. Smile
Wanabo wrote:
But in htaccess, you prevent them from viewing your site as well.

Agree... Cool
Be What you want to be...Wink
Jump to Forum:
New Thread Post Reply
Gebruik BBcode of HTML om naar; '[MOD]Prevent certain countries to register', te verwijzen!
उपयोगकर्ता ऑनलाइन
· अतिथि ऑनलाइन: 2

· सदस्य ऑनलाइन: 0

· कुल सदस्य: 77
· नवीन सदस्य: Jonathan Boytloong
लॉग इन
उपयोगकर्ता नाम


अभी तक सदस्य नहीं?
रजिस्टर करने के लिए यहाँ क्लिक करें.

पासवर्ड भूल गए?
नए पासवर्ड यहाँ अनुरोध करें.
अंतिम देखा उपयोगकर्ताओं
Your ad here below?
Website Version

Download latest
PHP Fusion Package
This Website is using PHP Fusion v7.02.07 as Current Version.

· BetterClimate.Net
· ComplaintSupport.Com
· Daily-Breaking-News.Com
· Kidiot.Org
· Php-Fusion.Asia
· Php-Fusion.Cn
· Php-Fusion.Fr
· Php-Fusion.Org
· Php-Fusion.Start-Pages.Com
· Rain-Radar.Com
· Speed-Testing.Net
· Start-Pages.Com
· WebhostingTrouble.Com
· WebmasterTrouble.Com
681,019 unique visits