|
|
Setting up Web Page Security
When developing web pages, one can turn the "debug" feature on in order to view details about the processing of the web page. One of the pieces of information displayed is the IP number of the computer from which you are working. This number is found under the "REMOTE_HOST" listing from the debug information for a web page you have developed and can be used to provide security for your web pages. Below are three examples of different ways to handle security using this IP address:
- Only allowing entry to the page from a particular computer. In this instance one uses the exact and full IP number for the computer which can access the page.
-
a) In this first case, when someone from a different computer, and therefore a different IP number, tries to access the page, the text "Private Page! Access is denied." is displayed and the page stops loading (<CFABORT>).
<CFIF cgi.remote_addr is not "IPnumber">
Private Page! Access is denied.
<CFABORT>
</CFIF>
|
-
b) In this second case, rather than displaying a warning message and then aborting the page, the user is redirected to a different page (<CFLOCATION>). Furthermore, the user will not be able to use the 'Back' button to try to return to the private page either.
<CFIF cgi.remote_addr is not "IPnumber">
- <CFLOCATION url="webaddress">
</CFIF>
|
- One can also allow only IP numbers containing a certain sequence of numbers to access a page. This would allow users at a particular location, but perhaps working from different computers to gain access to the web page. This is accomplished by using the keyword, "contains" as shown below:
<CFIF cgi.remote_addr CONTAINS "partofIPnumber">
- <CFLOCATION url="webaddress">
</CFIF>
<CFIF cgi.remote_addr CONTAINS "partofIPnumber">
Private Page! Access is denied.
<CFABORT>
</CFIF>
|
|
|
|
|
|
|
|