Skip to main content
Participant
August 5, 2006
Question

Access based on IP Address

  • August 5, 2006
  • 1 reply
  • 291 views
I would like to combine <cfif> and <cfinclude> to control part of the content of a page based on IP address ranges. Basically, when a user accesses the page from a defined range of IP addresses, the <cfinclude> calls foo.cfm into the page. If the user accesses the page from an IP address outside of the defined IP address range, <cfinclude> will return other_foo.cfm.

Any suggestions for a newbie?

Thanks in advance.
    This topic has been closed for replies.

    1 reply

    Inspiring
    August 5, 2006
    The variable CGI.REMOTE_ADDR or CGI.REMOTE_HOST should contain the IP information. Then compare to your range.