Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Direct User based on IP

Options
  • 14-08-2004 2:15pm
    #1
    Closed Accounts Posts: 155 ✭✭


    I am playing around with PHP and trying to do the following:
    When a person comes to the site a php script gets their ip, the user is then redirected depending on their ip.

    I only want to deal with Irish people so I would need to know the ip ranges for all the Irish ISP's. Simply I want a site that only Irish people can access. I know there are ways around it but it will suffice. I know of services that provide this feature but I'm looking to try and do it myself, I might actually learn something. Can anyone point me in a direction?


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Webhosting.info have an IP-to-country database you can download here


  • Closed Accounts Posts: 155 ✭✭h0stn0tf0und


    Thanks a lot, just what I was looking for. And in superfast time!


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Another one.

    http://www.maxmind.com/

    Bear in mind that these databases are never 100% accurate and reliance on them should be avoided if possible. For example, I have a static IP address with UTV and MaxMind and WH.info think I'm in the UK (because UTV is a UK company and assigned me an IP from a British block by mistake).

    adam


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    dahamsta wrote:
    Another one.

    http://www.maxmind.com/

    Bear in mind that these databases are never 100% accurate and reliance on them should be avoided if possible. For example, I have a static IP address with UTV and MaxMind and WH.info think I'm in the UK (because UTV is a UK company and assigned me an IP from a British block by mistake).

    adam
    Indeed. Afaik, my work IP isn't detected as an Irish one.

    If you're going to redirect, maybe you should have a message saying "This site is of no use to you if you aren't Irish. If you are Irish, and wish to access this site, please click here to contact the administrator".

    Then they click a link to a script which fires off an email to you containing their message and all their browser headers (including IP) so you can update your IP filter.
    If it was me, I'd just add a link allowing them direct access to the site, if the autodetect doesn't work.


  • Closed Accounts Posts: 155 ✭✭h0stn0tf0und


    Thanks for all the info and tips, much appreciated. Seamus, your idea of a failsafe is a good idea and will be used.


  • Advertisement
  • Registered Users Posts: 1,569 ✭✭✭maxheadroom


    Just another FYI - ntl broadband IP addresses are detected as being in the UK


  • Closed Accounts Posts: 2,525 ✭✭✭JustHalf


    I only want to deal with Irish people so I would need to know the ip ranges for all the Irish ISP's. Simply I want a site that only Irish people can access. I know there are ways around it but it will suffice. I know of services that provide this feature but I'm looking to try and do it myself, I might actually learn something. Can anyone point me in a direction?
    I think that your strategy is a bad idea. It's not much work to get that feature active, as you can see; but it will also be unreliable. You'll be pissing off your Irish users that are detected as British, US or whatever by telling them "Bugger off, you're not Irish".

    Why do you need to do this? Surely there are better ways of making it clear that the information offered by your site is only of use to Irish people?


  • Closed Accounts Posts: 155 ✭✭h0stn0tf0und


    JustHalf, why? because I can! I saw a few sites using this feature and wanted to play with it and find out its flaws, the flaws you have pointed out. One lame excuse I could give is that bandwidth costs money and I dont want to waste bandwidth serving pages to people in the states for example. Tbh I just want to play with it and see how it goes. Thanks for all the advice on the issue.


Advertisement