Tips on how to determine user location at registration please

Alvin63

Well-known member
Ok so can someone give me some advice on working this out please. It's in relation to this thread linked below - about verifying user age. There is one age verification option that is free to use, but it is ONLY for Uk users (ie anyone who has a Uk bank account). It simply links with all banks and only reveals age, nothing else.

But - although the majority of my users are Uk, there are still some from other countries. As they are in a minority, I could technically just manually verify their age separately somehow. (Or it might be that non uk users don't need age verification anyway - still looking into that ..........).

But what I'd need to be able to do, at registration, is determine which country they are from and have someway of redirecting the non uk ones somewhere or redirecting the uk ones to the age verification check. (This is ignoring the idea of VPN's for now).

Assume this might need incorporating in an API solution but I was wondering if there is away of setting up some auto IP checking when new members enter their email address to register. Presumably cloudflare turnstile does some kind of email check when doing its spam checking?

 
Here are a few add-on that do some geo-blocking, which may not quite be what you are really after if you want to allow non-UK to register still.


 
Thanks. Yes I don't really want to geoblock overseas members. Just distinguish them from Uk members but.....

The idea is if any IP is non uk they get sent somewhere, so would still be checked anyway. So then it wouldn't matter if they were using a VPN.
 
Assuming you are using Cloudflare like the site in your sig, you could use the Cloudflare geo header in a condition in your registration page and add some sort of redirect code to the page you have your verification stuff on.

Code:
<xf:if is="$xf.request.getServer('HTTP_CF_IPCOUNTRY') == 'GB'">
Redirect UK USER CODE
</xf:if>
 
Assuming you are using Cloudflare like the site in your sig, you could use the Cloudflare geo header in a condition in your registration page and add some sort of redirect code to the page you have your verification stuff on.

Code:
<xf:if is="$xf.request.getServer('HTTP_CF_IPCOUNTRY') == 'GB'">
Redirect UK USER CODE
</xf:if>
Thank you. That is really helpful. I don't quite understand how I do that but it sounds great - thanks. Where would the code go please?
 
I'd think you would want to use it in your register_form template, maybe even wrap the entire page in the condition to give your UK age verification code to UK users and the normal page as an else, although you need an age verification solution first before you can work out how you are going to integrate it.

Code:
<xf:if is="$xf.request.getServer('HTTP_CF_IPCOUNTRY')} == 'GB'">

 UK AGE VERIFY CODE

<xf:else />

normal register_form template code

</xf:if>
 
Back
Top Bottom