Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

redirect by ip adress

Posted 21 Jun 2002 13:04:42
1
has voted
21 Jun 2002 13:04:42 retailteam bv posted:
i've got a MSAcces table with 2 fields (id, ip). The ip numbers in the db should be 'banned' from a forum, when they open the .asp-page they should be redirected to another page when their ip is in the dbtable.

any suggestions anybody?
I've searched and searched without any results ...

btw; i'm using DW4

Replies

Replied 21 Jun 2002 14:49:23
21 Jun 2002 14:49:23 Andrew Watson replied:
create recordset of records from the table filtered by the current users IP.

If the recordset is empty redirect ..., if it isn't then show them.

eg

<pre id=code><font face=courier size=2 id=code>
&lt;%
set rsBanned = Server.CreateObject("ADODB.Recordset"
rsBanned.ActiveConnection = MM_Test_STRING
rsBanned.Source = "SELECT * FROM tblBannedIPs WHERE IP = '" + Request.ServerVariables("REMOTE_ADDR" + "'"
rsBanned.CursorType = 0
rsBanned.CursorLocation = 2
rsBanned.LockType = 3
rsBanned.Open()
rsBanned_numRows = 0
%&gt;
&lt;%
If Not rsBanned.EOF Then
Response.Redirect("banned.asp"
End If
%&gt;
</font id=code></pre id=code>

:: Son, im Thirty.... ::

Reply to this topic