[TYPO3] php script in <head> section

Dennis Hoffland d.o.hoffland at tele2.nl
Tue Sep 2 15:14:54 CEST 2008


Dear List,

 

I am trying to get the output from a php-script (a javascript to force
frames) into the <head> section of the rendered website page. In the
Typoscript setup I have the following lines:

 

right.headerData.40 = PHP_SCRIPT

right.headerData.40.file = fileadmin/scripts/frames.inc

 

However, in this case the output is put at the top of the HTML page, even
before the <head> tag: 

 

if (parent.location.href == self.location.href) {

window.location.href = "index.php";

</script><!DOCTYPE html

                PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

                <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />

 

<!-- 

                This website is powered by TYPO3 - inspiring people to
share!

                TYPO3 is a free open source Content Management Framework
initially created by 

Kasper Skaarhoj and licensed under GNU/GPL.

                TYPO3 is copyright 1998-2006 of Kasper Skaarhoj. Extensions
are copyright of their 

respective owners.

                Information and contribution at http://typo3.com/ and
http://typo3.org/

-->

 

The contents of my frames.inc file are:

 

<?php

print '<script language="JavaScript1.2" type="text/javascript">'."\n".
     'if (parent.location.href == self.location.href) {'."\n".
     'window.location.href =
"index.php?id='.$GLOBALS[TSFE]->page[uid].'";'."\n".
       '</script>';

?>

 

Does anyone have a solution?

 

Many thanks in advance.

 

Greetings

 

Dennis Hoffland



More information about the TYPO3-english mailing list