hello, i'm triying to use javascript redirect to main window after log in succeed in an iframe. this is my code :
if ($_GET['redirect']!='') {
$redirect=$_GET['redirect'];
$smart->assign('redirect',$redirect);
}
$redirect=$_GET['redirect'];
echo $redirect;
if(isset ($_SESSION['user'])&&$_SESSION['user']!='') {
$user->email=$_SESSION['user'];
$user->addCorporate();
$user->signIn();
$user->loadSession();
echo("<script language=\"javascript\" type=\"text/javascript\">");
echo "document.write('redirecting...');";
if ($redirect!='') {
echo 'self.parent.location = "'.$redirect.'"';
} else
echo 'self.parent.location = "index.php"';
//echo $redirect;
// redirect($redirect);
echo "</script>";
}
the echo $redirect displays http://xxxxxxxx/play.php?action=play&id=d59541b89828da34e9a8345a1bdafe2b
but the redirection is made to http://xxxxxxxx/play.php? (without the php option)
any ideas on how to fix this?
thank you in advance.