Skip to main content
December 10, 2014
Question

Finding page location in cf

  • December 10, 2014
  • 0 replies
  • 210 views

Hi People,

When I am using iframes or frames (older sites), as a extra security precaution I use the JavaScript function:

<SCRIPT LANGUAGE="JavaScript1.1">

if (top == self) self.location.href = "../index.cfm";

</SCRIPT>

<cfif (HTTP_REFERER DOES NOT CONTAIN "referer_page.cfm")

<cfabort>

</cfif>

It works great to keep visitors (hackers?) from opening and/or trying to post to the page.

The problem is that the JavaScript displays in source code and the less they know...

I know the JS is client side but is there anyway to create the function in the server side CF or otherwise hide from prying eyes?

I a running cf9 on my and most of my client sites.

Thank in advance

This topic has been closed for replies.