or the numerous ways you could do it:

<cfif ListFirst(cgi.remote_addr, ".") eq "192"
    AND ListGetAt(cgi.remote_addr, 2, ".") eq "168"
    AND ListGetAt(cgi.remote_addr, 2, ".") eq "5">
</cfif>

or

<cfif Left(cgi.remote_addr, 3) eq "192"
    AND Mid(cgi.remote_addr, 4, 3) eq "168"
    AND Mid(cgi.remote_addr, 9, 1) eq "5">
</cfif>

or

<cfset a = ListToArray(cgi.remote_addr, ".")>
<cfset b = "192.168.5">
<cfset ip_ok = TRUE>
<cfloop from="1" to="3" index="i">
    <cfif a[i] neq ListGetAt(b, i, ".")>
        <cfset ip_ok = FALSE>
    </cfif>
</cfloop>

<cfif ip_ok>

</cfif>

and I can't be bothered to think of more as it's getting very silly!

Enjoy

Paul

;-)

-----Original Message-----
From: Paul Johnston <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Date: 01 June 2001 16:54
Subject: Re: Brain isn't working yet...


>how about a regular expression?
>
><cfif REFind("192[.]168[.]5[.][12]?[0-9]?[0-9]", cgi.remote_addr)>
></cfif>
>
>or something like that!
>
>Paul
>-----Original Message-----
>From: Marcus <[EMAIL PROTECTED]>
>To: CF-Talk <[EMAIL PROTECTED]>
>Date: 01 June 2001 16:14
>Subject: Brain isn't working yet...
>
>
>>I'm trying to provide functionality to a select group of people on a
>>specific subnet. What I'd like to do is something along the lines of..
>>
>><cfif #cgi.remote_addr# is '192.168.5.0'>
>> Allow action
>></cfif>
>>
>>The thing being they use dhcp to allocate IP's and the address could
>>actually be any of the block. Is there a wild card I can use? or some
other
>>way to not specify the last number?
>>
>>Marcus
>>
>>
>>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to