473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

IP detection and using the info

Hi - I am not a technical person - I use dreamweaver to create basic websites. I have to have an age verification code to enter our site as it is alcohol related. Part of this is to ask the user their country, this is allocated a code and then the appropriate age verification is used and allows the user in to the site with relevant pages. I want to pick up country by IP address to reduce the number of click thru's. Has anyone done this before? Help!
Cheers
Karen
Feb 22 '08 #1
1 1064
jeffstl
432 Expert 256MB
You can get the IP Address easy enough, depending on what kind of server you are hosted on. Hopefully IIS and you are running ASP pages cause thats what Im posting, though there are just as simple ways if you are using php, or js.

Expand|Select|Wrap|Line Numbers
  1. 'ASP without Proxy detection 
  2. <%
  3. ipaddress = Request.ServerVariables("REMOTE_ADDR")
  4. %>
  5.  
  6.  
  7. 'ASP with Proxy detection 
  8. <%
  9. ipaddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
  10. if ipaddress = "" then
  11. ipaddress = Request.ServerVariables("REMOTE_ADDR")
  12. end if
  13. %>
  14.  
  15.  
Now the bad part is that once you HAVE the IP Address, the only way to determine it's country is by checking against a database of some kind. Whether you build and maintain your own database or use a hosting service is up to you.

These are some ive seen that provide the database
http://ip-to-country.webhosting.info/
http://www.ip2country.net/
Feb 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Darwin Fisk | last post by:
I have an app that is deployed that uses .config file settings. I have an update of that app that I am installing using a setup and deployment project. The basic setup process works fine. Now I...
60
by: Fotios | last post by:
Hi guys, I have put together a flexible client-side user agent detector (written in js). I thought that some of you may find it useful. Code is here: http://fotios.cc/software/ua_detect.htm ...
5
by: Chris | last post by:
After exhausting my search on the MS website, I can't find a straight answer. I fin dit hard to believe that MS left our something so useful in ASP.NET as screen resolution detection. Problem:...
7
by: mosaic | last post by:
Hi, all I really interested in how to check the memory leak of a program. Your smart guys, do you have excellent ideas that could share with me? Thank you. The following is my idea: In C...
5
by: Dave H | last post by:
I have an asp:listbox, allowing multiple selections, is there a quick check to see if there's more than one selected, or do I need to go through the whole list? Thanks, Dave
4
by: cwdjrxyz | last post by:
Take a look at http://www.explorerdestroyer.com/ and view the script used to detect IE. It uses quite a maze of elaborate script that examines user agents and many properties of a browser. Of...
10
by: petermichaux | last post by:
Hi, I'm picking apart the Yahoo! UI event.js library and stripping it down to just what I need. I'm also trying to make the parts I use better. I'm stumped on how to fix the code for the...
3
by: Tiggie | last post by:
Hi there! Well i'm getting dizzy on this topic, NO ONE seem to know an answer for it. I sure found hundreds of beat detection algorithms xD and I'm not gonna use others' algorithms, anyways what i...
0
by: origami.takarana | last post by:
Intrusion Detection Strategies ----------------------------------- Until now, we’ve primarily discussed monitoring in how it relates to intrusion detection, but there’s more to an overall...
10
by: Conrad Lender | last post by:
In a recent thread in this group, I said that in some cases object detection and feature tests weren't sufficient in the development of cross-browser applications, and that there were situations...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.