PDA

View Full Version : header() problem


king2k5
12-16-2007, 06:00 PM
I have a header() to redirect, and it works ok, the only problem is that i need it to break out of a frame.. i know how to do that via a link, just use target="_top", but is there any way to do it with a header()?

header("Location: login.php?error=iv");

NastyAccident
12-16-2007, 06:55 PM
The only way I know of doing that type of location change is via the use of an anchor tag on a page... The PHP header() function does not provide support to exit out of a frame as far as I know.

IE: <a href="testpagehere.php" target="_top">Oops, we've encountered an error</a>

Mwnciau
12-16-2007, 08:31 PM
You could use javascript:


<?php
echo "<script> top.location.href='http://www.google.com/'; </script>";
?>