views:

19

answers:

0

Hi all,

I have a simple html file saying;

<html>
    <head>
        <script>
        var someClickEvent = function() {
            location.href = '?action=someOtherAction';
        };
        </script>
    </head>
    <body></body>
</html>

This scripts runs at 'domain.com', now imagine this file is requested via an iframe in a 'local' html file.

When the click event is fired and location.href is actually executed the page should stay within the iframe.

This works like a charm in FF/Chrome etc. However IE7/8 is giving me a hard time, the href ends up being a 404 page (i get located to domain.com/, just a slash)

However when i change location.href to, lets say, location.href='http://www.google.com/'; google.com is indeed loaded within the iframe.. how can i achieve the same behaviour in IE with just the query parameter being changed but still forcing a new HTTP request?

Totally stuck on this :-(

Edit; Did some further investigation, basicly what i have is

<?php
if($_GET['action'] == 'logout') {
    header('Location: ?action=login');
    exit;
}
?>
<a href="?action=logout">Logout</a>

Once again, imagine this is requested via an iframe in a local html file. When i hit the logout link (note in my first example this was a location.href, however basic links are having the same issue, so it seems) i get a 404 page in my iframe (IE) (the same code shows the proper login screen (within the iframe) in FF when logging out).

What on earth is happening?

EDIT: Solved! It seems to be an issue with php sessions; http://nl3.php.net/manual/en/function.session-start.php#50905

Added the header (never heard of it though) and fixed my problem!

<?php header('P3P: CP="CAO PSA OUR"'); ?>