Hai everyone,
I've come up with this simple code (but I ended up doing it for the whole day tho..)
It basically capture the user info like the type of browser they are using, their server software and the most important thing is their IP address, and store them in the database.
- HTML: Select all
<%
Dim ipadd, browser, serversw
ipadd = Request.ServerVariables("remote_addr")
browser = Request.ServerVariables("http_user_agent")
serversw = Request.ServerVariables("server_software")
%>
- HTML: Select all
<%
Do while not pg.EOF
If pg("ipaddress") = ipadd Then 'If the user IP address appear to be exist in the database already, just redirect them to the main page!
pg.Close
pgConn.Close
set pg=nothing
set pgConn=nothing
Response.Redirect("default.asp")
End If
pg.MoveNext
Loop
'If the user IP address don't exist in the database, save them to the database..!
Set pg = pgConn.Execute("INSERT INTO pagerank (ipaddress, browser, serversoftware) VALUES ('" & ipadd & "', '" & browser & "', '" & serversw & "')")
Response.Redirect("default.asp")
%>
Now I can do my page rank statistic...
If there is any better way, please share, Thanks..