loggout.php fails to properly redirect

P

Phil Powell

loggout.php doesn't exactly redirect properly, and I have no idea what to do
about it... I need to bust out of the frame and go to top, so, how do I do
it?

Code that I have that fails:

<?


require_once('/home/nordicnet.no/include/nordicnet_global_vars_functions.php
');

setcookie('nordicnet_registration', 0, time() - 86400, '/'); // DELETE
COOKIE

?>

<html>
<head>
<meta http-equiv=Refresh content="0;URL=http://<?= $serverName
?>/index.php">
<script>
<!--
location.target = top;
location.href = 'http://<?= $serverName ?>/index.php';
//-->
</script>
</head>
<body>
<?= $font ?>Om du er her <a href=http://<?= $serverName ?>/index.php>klikk
her</a></font>
</body>
</html>

Phil
 
J

Janwillem Borleffs

Phil Powell said:
loggout.php doesn't exactly redirect properly, and I have no idea what to do
about it... I need to bust out of the frame and go to top, so, how do I do
it?

Code that I have that fails:

The following should work without the JavaScript:

<?
require_once('/path/to/nordicnet_global_vars_functions.php');
setcookie('nordicnet_registration', 0, time() - 86400, '/');
header("Location: http://$serverName/index.php");
?>


JW
 
P

Phil Powell

It does work, except that index.php opens up within the frame of
Palogget%20S1.php and not on _top, which is what I need for it to do.

Phil
 
J

Janwillem Borleffs

Phil Powell said:
It does work, except that index.php opens up within the frame of
Palogget%20S1.php and not on _top, which is what I need for it to do.

Don't you just hate frames? This calls for the dirty approach:

<?
require_once('/path/to/nordicnet_global_vars_functions.php');
setcookie('nordicnet_registration', 0, time() - 86400, '/');
?>
<html>
<head>
<script>top.location='http://<?=$serverName?>/index.php';</script>
</head>
<body>
<noscript>
Please click <a href="http://<?=$serverName?>/index.php"
target="_top">here</a>
To continue
</noscript>
</body>
</html>


JW
 
P

Phil Powell

OUCH! I forgot all about that!!!

window.parent.location.href = ....

That does the trick! Thanx
Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top