Hi,

First post to the forums, so be really grateful for some help!

I'm really pleased with my first drupal site: http://www.thetrack.org.uk/

but one of the places that visitors can navigate from places my site within a frame, that displays a banner above the main content.

This looks ugly (see http://www.scriptureunion.org.uk/thetrack/) and also messes up the site, as I don't seem to be able to login when the site is within a frame.

Please can I have some help with breaking out! I have tried:

<script LANGUAGE="JavaScript">
<!-- Begin
if (window != top) top.location.href = location.href;// End -->
  </script> 

and also tried:


<?php if (strpos('oldpage.com',$_SERVER['HTTP_REFERER'])) { header("Location:http://mynewpage.com"); } ?>

which I tried adding to index.php in the root of my site.

This failed saying more than one program had tried to write the header, which I assumed to be the html header, which bootstrap.inc tried to write.

Anyway, my knowledge of PHP is not good enough to write some code that works, so please can I ask for help.

Thanks in advance.

John

Comments

Christefano-oldaccount’s picture

At first glance your JavaScript looks like it should work.

Have you already tried and decided against using the frameprevention module?

sturgjoh’s picture

Thanks christefano.

I will try that module now. Didn't know it existed.

Thanks

John

sturgjoh’s picture

Thanks Christefano.

Frameprevention module worked a treat.

Me now happy again!

Cheers

John

Christefano-oldaccount’s picture

Fantastic!

sturgjoh’s picture

Hi Christefano,

Sorry to do a complete turnaround, but the module apeared to work and then when came back in, I had problems.
I guess I was too easily pleased!

I tried to figure out what was going on, but failed to do so, as my programming skills are not good enough.

I did post a support request http://drupal.org/node/159674 but as of yet have not had a reply, so i'm back here.

Fatal error: Call to undefined function: drupal_get_path_alias() in /home/sturgjoh/public_html/thetrack.org.uk/modules/frameprevention/frameprevention.module on line 85

Please can someone suggest what to do next.

thanks

John

P.S. Could this be to do with my .htaccess file, as the site is in a subdirectory from the html_public folder.

sturgjoh’s picture

I have got around the frame thing, but asking the referal site, to not refer me into to a frame, so I think the problem is solved.

Thanks (for putting up with me)!

John