#!/usr/bin/perl -w # Anti-framing script. # This page is shown if the user comes from a website that frames my web pages. # [URL: http://www.susannawinter.net/cgi/framing.pl ]. # Copyright 2001-2006 by Susanna Winter # Version history: # v0.1 - Initial version in 2001 # v0.2 - modified referer/link parsing in 2002 # v0.3 - March 2003: new layout, added Mac disclaimer and version history # v0.4 - May 2003: Getting fed up with having to edit numerous scripts every time I # change something in the site layout I've now changed the SSI files to # be read into the scripts rather than have static html code # -> flexible for me but, overall, not very portable. # v0.4.1 - Nov 2003: fixed a bug in URL parsing when no specific page was requested (just # the main page) # v0.4.2 - Jul 2004: added & modified the text a bit # v0.4.3 - Mar 2005: changed layout to match new site use strict; use CGI qw(:standard); # files normally included with SSI my @header1 = (); my @header2 = (); if (-e "/var/www/swnet/header1.html") { open (FH, "/var/www/swnet/header1.html"); @header1 = ; close(FH); } if (-e "/var/www/swnet/header2.html") { open (FH, "/var/www/swnet/header2.html"); @header2 = ; close(FH); } my $referer = $ENV{'HTTP_REFERER'}; $referer =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; my $rest = ""; while ($referer =~ $ENV{'HTTP_HOST'}) { (my $crap, $rest) = split($ENV{'HTTP_HOST'}, $referer, 2); $referer = $rest; } my $file = ""; if ($rest =~ /\.html/) { ($file, my $crap) = split(".html", $rest, 2); } my $url = ""; if ($file ne "" ) { $url = "http://" . $ENV{'HTTP_HOST'} . $file . "\.html"; } else { $url = "http://" . $ENV{'HTTP_HOST'} . "/"; } print "Content-type:text/html\n\n"; print @header1; print "\tThis Page Is Being Framed by a Third-party Website\n\t"; print "\n"; print @header2; print "\n\t
\n\t
\n\t
\n\t
\n\n\t"; print "
\n\t
Menu
\n\t
\n\t\n\t"; print "\n\t
\n\t"; print "\n\t
\n\t"; print "
\n\t
Search
\n\t
\n\t"; print "
\n\t
\n\t\n\t\n\t
\n\t
\n\t
\n\t\n\t
\n\t"; print "
\n\n\t
\n\t"; print "
Framing
\n\t
\n\n\t"; print "\t

This Page Is Being Framed by a Third-party Website

\n\n"; print "

What Is Framing?

\n"; print "

\"Framing is the process of allowing a user to view the contents of one website while it is framed by information from another site, similar to the \'picture-in-picture\' feature offered on some televisions.\"

\n\n"; print "

\"Framing may trigger a dispute under copyright and trademark law theories because a framed site arguably alters the appearance of the content and creates the impression that its owner endorses or voluntarily chooses to associate with the framer.\"

\n\n"; print "

Quotes from a Nolo Law Center article on \"Linking, Framing and Inlining\".
Want more information? Try this Google search: http://www.google.com/search?q=framing+linking+law.

\n\n"; print "

What Now?

\n"; print "

You can try this link to view the page without frames: $url.

\n\n"; print "

If the link does not work (e.g. if you get a \"File Not Found\" error), consult the site map or use the search function on the left.

\n\n"; print "

What Can You Do to Avoid Seeing This Message in the Future?

\n"; print "
    \n\t
  • Stop using a search engine that displays search results in frames, e.g. Xquick.com, AOL Search, Eniro, About.com, Ask Jeeves and even Google Image search (shame on you Google!)
  • \n\t"; print "
  • Hide the referer information your browser is sending, e.g. by setting network.http.sendRefererheader to 0 in Mozilla or Mozilla Firefox.
  • \n"; print "
  • Use a filtering proxy (WebWasher, Privoxy, Proxomitron) to do the same.
  • \n"; print "
\n\n"; print "

NB: If you are using Mac, you might get this page without any reason. This is because of the different way Mac browsers handle referers compared to Linux or Windows machines. Sorry for the inconvenience. :(

"; print "
\n\t
\n\n\t"; print "
\n\t
\n\t
\n\n\t
"; print "
\n\t
\n\t
[XHTML 1.1]
This document is made with valid XHTML 1.1 markup. Check your site for (X)HTML validity with the W3C Markup Validation Service.
\n\t"; print "
[CSS3]
The style sheet markup on this page is made with valid CSS, albeit with its unfinished and as of yet experimental third versi on (Level 3, CSS3). Check your site for CSS validity with the W3C CSS Validation Service.
\n\t"; print "
[Creative Commons]
Some rights reserved. This site and parts thereof — unless otherwise indicated — are licensed under the Creative Commons license Attribution-NonCommercial-ShareAlike 1.0 Finland.
\n\t
\n\n\t"; print "
This site is optimized for any reasonably standards-compliant browser (both XHTML and CSS).
\n\tQuestions and comments to webmaster\@susannawinter.net.\n\t
\n\t
\n\t"; print "
\n\t
\n"; print "\n\n\n"; print "\n";