b3ta.com board
You are not logged in. Login or Signup
Home » Messageboard » XXX » Message 2353023 (Thread)

# His name's Timothy.
you know, i actually made this in the year 2000, on an ancient Apple Mac 6100/60, when I was learning photoshop.

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.
(, Tue 18 Nov 2003, 18:37, archived)
# Can't help you with the asp I'm afraid
but nice picture!
(, 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.
(, Tue 18 Nov 2003, 18:38, archived)
# does he
control the weather?
(, Tue 18 Nov 2003, 18:38, archived)
# eeep!


my advice is to use PHP
(, Tue 18 Nov 2003, 18:39, archived)
# heh heh heh
I knew someone'd say that...
(, Tue 18 Nov 2003, 18:40, archived)
# thats because we're right
(, Tue 18 Nov 2003, 18:41, archived)
# ha
i will match your kitten!


(repost)
(, 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
(, 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


(, Tue 18 Nov 2003, 18:45, archived)
# Thats a repost
isn't it?
(, 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.
(, Tue 18 Nov 2003, 19:15, archived)
# Yup
much better idea.
(, Tue 18 Nov 2003, 19:28, archived)