Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

Finding IP address of Visitor usign ASP

 
webmaster forum
nikon  Offline
Activity
0%
 
New Coder
Posts: 20
Topics: 13
September 11, 2008, 07:19:29 PM

I want to find IP address of visitor and I want to redirect it to some page as per their country. Can anyone tell me if it is possible to get IP address of visitor in Asp?

Any help is appreciated.
 
webmaster forum
jaincool  Offline
Activity
0%
 
Regular Coder
Posts: 50
Topics: 15
September 15, 2008, 11:53:59 AM

As found in some of the post here in the same forum ,you can try this:
Active Server Pages (ASP) has a built-in object called ServerVariables. This object holds useful information on Environmental Variables. One the variable is "REMOTE_ADDR" which holds the IP address of the visitor. To request the IP address of host machine, use the following code:
Response.Write Request.ServerVariables("REMOTE_ADDR")
 
webmaster forum
Activity
0%
 
New Coder
Posts: 49
Topics: 14
September 16, 2008, 03:46:22 AM

Hi
You can collect IP address of the visitor by using Request object and its ServerVariable pairs. Below is the sample code to get it done.

Function UserIP()
 ’ This returns the True IP of the client calling the requested page
 ’ Checks to see if HTTP_X_FORWARDED_FOR has a value then the client is operating via a proxy
 UserIP = Request.ServerVariables ( "HTTP_X_FORWARDED_FOR" )
 If UserIP = "" Then
     UserIP = Request.ServerVariables ( "REMOTE_ADDR" )
 End if
End Function

Please use the below link for your reference

http://aspdownload.com/read/?art=3225
 
webmaster forum
Jeremy  Offline
Activity
0%
 
Skilled Coder
Posts: 103
Topics: 4
WWW
July 01, 2010, 01:53:26 PM

it is really hard to stop people based on ip, because they can just use an isp with a wide range of non-static ones, or proxies, or different wifi around town. i am sorry you are having this trouble man, i had a forum and i had to close it because of people like that Sad

Second Home Mortgage
Private Student Loans
 
webmaster forum
singam  Offline
Activity
0%
 
Regular Coder
Posts: 50
Topics: 19
August 13, 2010, 09:57:38 PM

I needed IP spoofing. According to a requirement, I need to commutate with a device over crossover cable for configuring it. But the problem is , when device boots  up , it gets an arbitrary IP when it is operating  over crossover connection as it cannot contract with DHCP Server. My PC is in a different network from the device. So i cannot communicate with that device thru socket programming. But one thing I can do, i can search the device using some proprietary protocol and find its information like its IP.

As I can get the IP of device, if I change the pc IP according to Device IP so that they are in the same network then I will be able to communicate with the device and configure it.  AddIPAddress Function of iphlpapi.dll can be used to add a specified IPv4 address to the specified adapter and    DeleteIPAddress function can be used to delete an IP address previously added using AddIPAddress. So using these two functions you can do IP spoofing .Your real IP4 address will be changed for a very short time when you are sending the packet. Another thing to note, a network interface can hold multiple IIP address and holds it in a IP table.
« Last Edit: March 17, 2011, 10:28:21 PM by Admin »
 
webmaster forum
mak14317  Offline
Activity
0%
 
Skilled Coder
Real name: Janne
Location: california
Gender: Male
Age: 26
Posts: 108
Topics: 1
WWW
April 29, 2011, 02:29:38 AM

just check it out n try
<%
    ip_address = Request. ServerVariables("HTTP_X_FORWARDED_FOR")
    if ip_address = "" then
        ip_address = Request. ServerVariables("REMOTE_ADDR")
    end if
%>

herbal vaporizer
Happy vappy vaporizer
Eclipse Vape
Ivape
 
webmaster forum
kellylsn  Offline
Activity
0%
 
Professional Coder
Posts: 229
Topics: 7
July 21, 2011, 02:45:14 AM

thanks for this posting, its very nice to know about finding IP of visitor.

Payday Loan
Online Easy Loans
 
webmaster forum
dianna  Offline
Activity
0%
 
Regular Coder
Posts: 88
Topics: 10
WWW
August 03, 2011, 02:20:44 AM

Whenever a browser sends a request for a page, it also sends a number of other headers to the script, containing information such as the browser type. It also includes information such as the visitors IP address. This can be particularly useful when creating an online security scan, or logging their IP address in an online forum.

Pakistan's Local Search engine
 
webmaster forum
Life Is Good!
Activity
0%
 
Professional Coder
Gender: Female
Posts: 242
Topics: 3
WWW
August 23, 2011, 10:05:12 AM

so there really is a way to do this one..

Affordable Custom Web Design Services
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page January 31, 2012, 07:33:42 PM