Forums
This topic is locked
Static vs. dynamic IP logging - Strange behavior
Posted 30 Aug 2001 04:38:57
1
has voted
30 Aug 2001 04:38:57 Martin Ruppert posted:
<font face='Arial'>Hi!I wrote a little page that logs IP addresses of visitors who access a
password protected area on my website. To retrieve the IP address I
used the Request.ServerVariables("REMOTE_ADDR"command. So, when
somebody logs into my website, his/her IP address and additional user
information (from the login page) are stored in a access log (SQL2000
table). In order to submit the insert record form, I added the
onUnload=document.form.submit... to the body tag and a redirect after
2 seconds in the header tag.
The funny thing is, that it all works just fine if I access the page
via a fixed IP address (the access is logged), but if I use my dial up
connection which obviously assigns a new IP addess every time I go
online, it doesn't log that access. However, if i change the code on
the logging page; add a submit button and remove the onUnload &
redirect code, it works fine again.
Any suggestions? Any help would be greatly appreciated!
Martin
Below is the non-working code - I used Ultradev to build the page:
<meta http-equiv="refresh" content="2;URL=DocOverview.asp">
</head>
<body bgcolor="#153785" text="#000000"
onUnload="document.accesslog.submit()">
<p> </p>
<p> </p>
<p align="center"><b><font face="Arial, Helvetica, sans-serif"
size="7" color="#CCCCCC">Login
Page is being processed.......</font></b></p>
<p> </p>
<form method="POST" action="<%=MM_editAction%>" name="accesslog">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">:</td>
<td> <font color="#FFFFFF">
<input type="hidden" name="AccessIP" value="<%=
Request.ServerVariables("REMOTE_ADDR" %>" size="32">
</font></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td> <font color="#FFFFFF">
<input type="hidden" name="UserID"
value="<%=(User.Fields.Item("UserID".Value)%>" size="32">
</font></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td> <font color="#FFFFFF">
<input type="hidden" name="AccessTime"
value="<%=(User.Fields.Item("CurrentVisit".Value)%>" size="32">
</font></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td> <font color="#FFFFFF">
<input type="hidden" name="FullName"
value="<%=(User.Fields.Item("FullName".Value)%>" size="32">
</font></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><font color="#FFFFFF"></font> </td>
</tr>
</table>
</font id='Arial'>