Hvordan får jeg folks IP adresse?
Jeg bruger dette script:
<%
Dim objHitConn, strHitSQL, objHitRs, intHits, strHitFile
Set objHitConn = Server.CreateObject("ADODB.Connection")
objHitConn.Provider = "Microsoft.Jet.OLEDB.4.0"
objHitConn.Open Server.MapPath("counter.mdb")
strHitFile = Request.ServerVariables("url")
strHitSQL = "SELECT Page, Hits From Main Where Page='" &
strHitFile & "'"
Set objHitRs = Server.CreateObject("ADODB.Recordset")
objHitRs.Open strHitSQL, objHitConn, 1, 2
if objHitRs.EOF Then
objHitRs.AddNew
intHits = 0
objHitRs.Fields("Page").Value = strHitFile
Else
intHits = objHitRs.Fields("Hits").Value
End if
intHits = CInt(intHits) + 1
objHitRs.Fields("Hits").Value = CStr(intHits)
objHitRs.Update
objHitRs.Close
objHitConn.Close
Set objHitRs = nothing
Set objHitConn = nothing
Call DisplayImg(intHits)
function DisplayImg(intNum)
Dim itmCur, tmpCur
Response.write ""
For itmCur = 1 To Len(intNum)
tmpCur = Mid(cStr(intNum), itmCur, 1)
Response.write ""
Next
Response.write ""
End function
%>
--
Vil du lære at kode HTML, XHTML, CSS, SSI eller ASP?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials