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.

IP Address of the visitor

 
webmaster forum
universal  Offline
Activity
0%
 
New Poster
Posts: 14
Topics: 9
March 06, 2008, 04:44:21 AM

Hey All,

I need a code in ASP which will give me the IP Address of the visitors for my site.

I want to store these IP Address in Database.

Thanks in Advance! Grin
 
webmaster forum
ohsuria  Offline
Activity
0%
 
New Coder
Posts: 16
Topics: 2
March 24, 2008, 01:57:13 AM

hi universal,

try this:

Quote
Response.Write Request.ServerVariables("REMOTE_ADDR")
 
webmaster forum
maha22  Offline
Activity
0%
 
New Poster
Posts: 11
Topics: 5
August 13, 2010, 12:23:05 AM

I'm not sure why the trolls are so interested in you, that 'I'm in love' guy seems to have developed an unhealthy obsession for you, but why?

No you can't find out the IP address of Y!A users, or where they're from.  Yahoo keeps that info secret, and for good reason.  If that info falls into the wrong hands, some serious trolling could be done.

Yahoo!7 is the australian site, au. answers. yahoo. com
Yahoo!Xtra is the NZ site, nz. answers. yahoo. com
Yahoo! is the normal (or USA) site, answers. yahoo. com

Just because someone is using the Yaho!7 doesn't necessarily mean they're from Australia though, someone from somewhere else could easily get into the Australian site just by changing 'nz' to 'au', for example, in the address bar.  Or by clicking the Aussie flag at the bottom of the screen.  If the email comes up 'Yahoo!7' it just means they were using the Aus site at the time they sent the message.

I've frequently found myself ending up on the Australian site just byclicking the link to another question in an answer to a Y!A question, that was posted on here.  So it's really easy to go from one country's site to another.


Edit: Removed self promotion links. They are only allowed through signatures.
« Last Edit: August 15, 2010, 10:52:01 PM by Admin »
 
webmaster forum
dianna  Offline
Activity
0%
 
Regular Coder
Posts: 88
Topics: 10
WWW
August 10, 2011, 01:29:35 AM

Code:
$ip=@$REMOTE_ADDR;
echo "<b>IP Address= $ip</b>";
The above code will display this IP address= 119.159.1.134
IP address if the register_global is off
If at php.ini if register_global is set to Off then we have to change the script a bit to get the address. Here it is
Code:
$ip=$_SERVER['REMOTE_ADDR'];

Pakistan's Local Search engine
 
webmaster forum
netshet  Offline
Activity
6.67%
 
Regular Coder
Posts: 73
Topics: 2
WWW
August 10, 2011, 01:50:55 AM

How to get IP address of the visitor browser in ASP
We can collect IP address of the visitor by using Request object and its ServerVariable pairs. IP address of the user is required in many applications for different purposes. IP address are collected and logged for security purposes on different occasions like credit card process, member signup time etc. From the IP address we can identify the location of the visitor. However we will restrict ourselves only to know how to collect IP address of the visitor browser from the HTTP header information.

In PHP we can find out the IP address and details are here.

In ASP as we will use the http header information so it is better to read the full article on http header and request object here.

We will use http header name REMOTE_ADDR or REMOTE_HOST to get the IP address. Here is the code.
Code:
<%= Request.ServerVariables("REMOTE_ADDR")%>

hair transplant
 
webmaster forum
FUE hair transplant in Pakistan
Activity
0%
 
New Coder
Real name: Harry Martin
Location: Pakistan
Gender: Male
Posts: 26
Topics: 0
WWW
November 04, 2011, 11:13:11 PM

thanks guys for your nice suggestions. I have noted them for future use.
 
  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 February 04, 2012, 01:55:05 AM