• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Finding page location in cf

Participant ,
Dec 09, 2014 Dec 09, 2014

Copy link to clipboard

Copied

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

Views

160

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources
Documentation