[thelist] CFMX: IP Address Ban/Prevent

Russ russ at unrealisticexpectations.com
Tue Feb 24 21:54:31 CST 2004


Joshua and everyone,

Thanks again for the assistance with the IP.  I've gotten a bit smarter
and now what I do is simply display or not display the form elements
that users can interract with based upon an IP address in the list.

One of the things that's started to happen is that a certain IP address
at the D class level (I hope I'm stating that correctly), and I'm
wondering if there's a catch-all to basically say to block:

192.168.1.*

In CFMX on RedHat.

Thanks,

Russ


> In application.cfm...
> 
> <cfquery name="whatever"...>
>   SELECT 1
>   FROM banned_ips
>   WHERE addr = '#cgi.remote_addr#'
> </query>
> 
> <cfif whatever.recordcount>
>   <cflocation ...>
> </cfif>
> 
> If the list of banned IP's is small, then you may consider creating a
> comma-separated list of banned IP's and then doing something 
> like this:
> 
> --- ips.cfm ---
> 
> <cfset banned_ips = "123.45.67.8,124.56.78.9">
> 
> --- application.cfm ---
> 
> <cfinclude template="ips.cfm">
> 
> <cfif ListFind(banned_ips, cgi.remote_addr)>
>   <cflocation ...>
> </cfif>
> 

> <><><><><><><><><><>
> Joshua Olson
> Web Application Engineer
> WAE Tech Inc.
> http://www.waetech.com/service_areas/
> 706.210.0168




More information about the thelist mailing list