I am trying to write an ASP script to pick up a visitors IP address or host then trace it back to source. This is so I can record where my users are coming from and hopefully increase security on my site.
Is there no easier way, I can install any components on my host. Is there asolution where by I can post the information to a server somehere and get a result sent back to my asp page?
You might be able to post the IP address into the WHOIS texbox at the Network Solutions website, and parse the returned HTML to find out who owns it. But that seems like a lot of work to me.
<!--Cut & paste code After database is in place. To test you will need to make sure that they referenced the page from a link. If they type in your URL then the content only will be displayed. It will take a bit more coding if you want to exclude referrers from your own site.-->
<!--Check if they are coming from another page. If so send them to the same page and include the url with a . at the end-->
<script>
function redirectPage() {
if (document.referrer) {
var test = document.referrer
var go= location+"?from="+"\""+test+"."+"\""
window.location.href= go;
}
}
</script>
<body onload=redirectPage()>
<!--If there is a . at the end of the url then right it to the database else do nothing-->
<%
Dim check
check = Right(Request("from",1)
If checkIll = "." then
Dim from
from = TRIM( Request( "from" ) )
DIM Con
Set Con = Server.CreateObject("ADODB.Connection"
Con.provider="microsoft.jet.oledb.4.0"
Con.open=server.mappath("\"&"db.mdb"
Set RS = Server.CreateObject( "ADODB.Recordset" )
RS.ActiveConnection = Con
RS.CursorType = adOpenStatic
RS.LockType = adLockOptimistic
RS.Open "SELECT * FROM table WHERE 1<>1", Con
RS.AddNew
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.