Hello
How can i find ip address of visitors who visit my web site .also store these ip in my database.how it done
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Posted Oct 15, 2010, 9:56 AM
<%
Dim oGeoIP,strErrMsg
Dim strIP,strCountryName,strCountryCode
Set oGeoIP = New CountryLookup
oGeoIP.GeoIPDataBase = Server.MapPath("GeoIP.dat")
If oGeoIP.ErrNum(strErrMsg) <> 0 Then
Response.Write(strErrMsg)
Else
strIP = request.ServerVariables("REMOTE_ADDR")
strCountryName = oGeoIP.lookupCountryName(strIP)
strCountryCode = oGeoIP.lookupCountryCode(strIP)
End If
Set oGeoIP = Nothing
%>
http://www.codetoad.com/asp_geoip.asp
http://www.ip2location.com/free.asp
http://www.aspsnippets.com/Articles/Find-Visitors-Geographic-Location-using-IP-Address-in-ASP.Net.aspx
http://ipaddressextensions.codeplex.com/
http://stackoverflow.com/questions/1409108/how-to-get-visitor-location-country-state-and-city-using-asp-net
Digamber PatilPosted Oct 15, 2010, 8:13 AM
Posted Oct 15, 2010, 6:13 AM
Request.ServerVariables("remote_addr") instead of Request.Servervariables("REMOTE_HOST").
"REMOTE_HOST" willl return the name of the host machine if your server is set up to perform reverse DNS lookup when the site is accessed.
http://www.w3schools.com/asp/showasp.asp?filename=demo_server
You will get the IPAddress for the visitor.
Digamber PatilPosted Oct 15, 2010, 5:01 AM
Ritesh DiyawarPosted Oct 15, 2010, 3:25 AM
u should use this line in Asp.net
HttpContext.Current.Request.UserHostAddress;