Hello,
I have this script that i try to get working.
The problem is it send me to the /blocked page but it do it even if i have a IP from Denmark/DK
The code
This is from the website
Any idea what to do?
Printable View
Hello,
I have this script that i try to get working.
The problem is it send me to the /blocked page but it do it even if i have a IP from Denmark/DK
The code
This is from the website
Any idea what to do?
Can you please post the code?
Worked fine here. Do you have Cloudflare or any other HTTP reverse proxy service?
Change the first line to this
Code:$ip = $_SERVER['HTTP_CF_CONNECTING_IP']; // the IP address to query
Oh, I see. It has something to do with that URL. Just use this, http://ip-api.com/php/ and it will work.
You don't really need Pro, I also use IP-API and have 20k daily pageviews and I run with the free version.
The problem is that a person give my hotel layer7 attack on the client and if you read this:
"Our system will automatically ban any IP addresses doing over 250 requests per minute."
The user send over 1000 ips every minute so it ban the server ip so i need to unban the ip every minute so thats why i payed for PRO - You don't have a idea how it will work?
Since you're using Cloudflare, you should be able to just do this:
This will block all countries except Denmark.PHP Code:<?php
if($_SERVER["HTTP_CF_IPCOUNTRY"] != "DK")
{
echo 'Not from Denmark, no access allowed.';
exit;
}
?>