Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending User to sites, depending on there IP

Status
Not open for further replies.

shinlithium

Programmer
Jun 22, 2002
7
CA
whats up everyone im new here.

and i have a question=)
my question is, i run a web server, and what i want to accomplish is when a user enters my site, i want the script to find there ip and open a new browser window and send them to a particular site, depending on what there last number of there ip is. (i.e if ur ip ends with a 1 then u will be sent to site A, and if it ends with a 2 it will send you to site b, etc etc) so far i can find the ip by using this script

sIPfull = curUser.IP()
sIPc = Left(sIPfull, InStrRev(sIPfull, ".") - 1)
sIPb = Left(sIPc, InStrRev(sIPc, ".") - 1)
sIPa = Left(sIPb, InStrRev(sIPb, ".") - 1)
sIPa = sIPa & ".*"
sIPb = sIPb & ".*"
sIPc = sIPc & ".*"

so a little help would be apprecitated! thanks!
 
shinlithium,

I understand your question, but why would you want to do that?

fengshui_1998
 
when users from Europe come in my site
a banner in there language will pop, when a person from china comes into my site,a banner in chinese will pop up.

it just makes things easier for them by maing my site more diverse. And since you can somewhat tell the location of the person by there ip, thats what i intend to do with it

thanks
 
Once you've retrieved thier IP number, you could use the "Response.Redirect" statement.

Ex:

If Right(strIP, 1) = 1 Then Response.Redirect "Site_A.asp"
If Right(strIP, 1) = 2 Then Response.Redirect "Site_B.asp"

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top