Home » Messageboard »
XXX » Message 2353023
(Thread )
His name's Timothy.
Does anyone here speak ASP? I'm trying to make an IP blocking script which reads a list of values from a database and redirects if your IP is there. Looks like this so far: dim BannedIP BannedIP=Request.ServerVariables('REMOTE_ADDR') if rsBannedIPs.Fields.Item='BannedIP' Reponse.Redirect 'http://www.whereever.com' only trouble is, this only reads one line from the recordset. Can anyone help me? I'd be awfully grateful. Love, Trumpet.
(
trumpet ,
Tue 18 Nov 2003, 18:37,
archived )
Can't help you with the asp I'm afraid
but nice picture!
(
King Ralph is drunk ,
Tue 18 Nov 2003, 18:38,
archived )
AAAARRRRRRRRGH!
sign him up ! That cat is a feline anarchist in the making. Sorry I can't help with the reptile, though.
(
TheFelineAnarchist ,
Tue 18 Nov 2003, 18:38,
archived )
does he
control the weather?
(
viperrr mostly comes out at night, mostly ,
Tue 18 Nov 2003, 18:38,
archived )
eeep!
my advice is to use PHP
(
lo, the OTHER greebo warrior ,
Tue 18 Nov 2003, 18:39,
archived )
heh heh heh
I knew someone'd say that...
(
trumpet ,
Tue 18 Nov 2003, 18:40,
archived )
thats because we're right
(
lo, the OTHER greebo warrior ,
Tue 18 Nov 2003, 18:41,
archived )
ha
i will match your kitten! (repost)
(
moose monkey ,
Tue 18 Nov 2003, 18:42,
archived )
i dont know asp
but the best thing to do is to find a website that has already done it and just steal the code. thats what i used to do
(
icedragon ,
Tue 18 Nov 2003, 18:43,
archived )
Arrg!
I'm no expert, but it looks like you need to iterate over the result set. Try something like Do While Not rsBannedIPs.EOF if rsBannedIPs.Fields.Item="BannedIP" Reponse.Redirect "http://www.whereever.com" rsBannedIPs.MoveNext Loop
(
UncleLewy ,
Tue 18 Nov 2003, 18:45,
archived )
Thats a repost
isn't it?
(
Lethe is carrying a spade. SPANG. ,
Tue 18 Nov 2003, 18:45,
archived )
Cleverer way might be
to select it already in the sql.. like: rs.open "select * from ips where ip = '" & bannedip & "'", conn,3,3 if not rs.eof then response.redirect "about:blank" end if short one, hope you understand.
(
Clark CliffClive Jingel KjellElg ,
Tue 18 Nov 2003, 19:15,
archived )
Yup
much better idea.
(
UncleLewy ,
Tue 18 Nov 2003, 19:28,
archived )
Hide
Hide post If you want to unhide this post later, click the "update profile" link in the top navigation bar, and scroll down to the bottom.
Ignore
Shush them a week You will be blisfully unaware of this user for just one week
Mute user You will not see this users messages again
Block user You will not see them and they will not see you