> From: "Stephen" <[EMAIL PROTECTED]>
> 
> I have a PHP script that works on older versions of PHP but on 4.3, it
> outputs nothing. Here's my code:
> 
> <?php
> echo '<SCRIPT language="JavaScript" type="text/javascript">'."\n"
> ."\n".'if (document.location == top.location)'."\n"
> .'  top.location="home.php?goto='
> .base64_encode($_SERVER["REQUEST_URI"]).'";'."\n"
> .'</SCRIPT>';
> ?>
> 
> The problem is, when it redirects, the URL variable goto is empty. I'm
> assuming this has something to do with base64_encode. Since this code snipet
> is on every page of my site, it'd be a hard hassle to change it so is there
> a setting in PHP I need to tweak or should I set aside a few hours to edit
> this code? If the latter, what should I change it to?

I hope this relates -- I use the code below as a "force frame", placing it
at the top of all content pages as an include. (In my case info.php posts to
index.php, which allows any content page that's called directly to be
returned in a frameset.)

<?
$path_array = explode("/", "$REQUEST_URI");
$page_name = array_pop($path_array);
?>
<script language="JavaScript">
<!--
if (top.location == self.location) {
    top.location.href = "info.php?contents=" + "<?=$page_name?>"
}
// -->
</script>

--
Lowell Allen


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to