English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a CSV file with 6 fields IP_FROM, IP_TO, COUNTRY_CODE, COUNTRY_NAME, CONTINENT_CODE, CONTINENT_NAME. Fields 1 and 2 consist of an IP address range run together as a multi digit number ie 2162545168 to 2162545407 (no leading zeros). The other important field is the country name which for the purposes of this code needs to distinguish between UNITED STATES, UNITED KINGDOM and neither.

Basically I need to pull the IP address of the visitor to my site, send a search to the CSV file, and if a UK visitor has visted .com, send them to .com/uk so I can give them the option of going to the UK site and vice versa send a US visitor to .co.uk/us. If neither country is identified send them to .com/unidentifiedcountry.

CSV file (Zipped) is available from

http://www.ipligence.com/freetools/ipligence-community-200701.zip

Please can someone code something for me either using this or something similar (must be free with no limits on searches etc.) Thank you

2007-02-16 10:55:57 · 4 answers · asked by Status: Paranoia 4 in Computers & Internet Programming & Design

4 answers

You should look it up on the official Javascript website, that should help.

2007-02-24 10:56:00 · answer #1 · answered by Radical One 6 · 1 0

You can do this in a number of ways;

Use the XMLHTTPRequest object to pull the csv file to the client
(Because this is cross domain a warning will appear on the client though) and analyse it there and then (not easy but feasable)

The best way is to pull the file to the server periodically (once a day say). Store it on the server and every time a request comes in for the page read the header and it will tell you what the users IP is. From this (I assume ASP here) create the page dynamically and use the response.redirect method to forward the user.

You can use the file System Object to go through the file and find what you are looking for on the server or create an ActiveX object yourself.

You can use Javascript or VBScript as backend scripting (server side)

Does this help ?

2007-02-16 12:12:52 · answer #2 · answered by id36uk 3 · 0 1

It sounds as though you're mighty miffed at Christians. To answer the question, part of it is some Christians grew up in judgmental homes - therefore are insecure about their faults, perceived or real. When you think about it, teaching that those who aren't Christians go to hell is pretty severe. Many kinder souls would reject that and choose a different faith. However, for the MOST judgmental, it probably has less to do with the religion and more to do with the person. Many Christians are very kind-hearted people. One CHOOSES to focus on the severe elements of what is taught in some churches - or one chooses a more loving approach. Maybe the most insecure simply choose Christianity as a platform for their worldview. The ultimate power rests with the individual - religion is often just an excuse. The real question may be, God does not judge so why should we? God is whole and complete. Rejection has no effect on God. Therefore She (or He if you prefer) has no need to judge.

2016-03-28 23:10:59 · answer #3 · answered by Anonymous · 0 0

This isn't really a job for javascript. Javascript runs on the client machine - ie the person doing the browsing - so they would have to have access to this file.

It should really be done with back-end scripting like PHP or Python.

2007-02-16 21:18:57 · answer #4 · answered by Daniel R 6 · 0 1

fedest.com, questions and answers