Php 在rel窗口中启动重定向url?

Php 在rel窗口中启动重定向url?,php,iframe,hyperlink,Php,Iframe,Hyperlink,我正试图在我的登录脚本中插入一段代码。如果用户帐户是一种特殊类型,我希望它重定向到另一个url 这一点我知道怎么做。但我希望url窗口在我网站上的一个漂亮的照片框中打开。这是一种css框iframe窗口。我的大部分链接都是通过使用以下代码打开的: <a href="something.php?to=<?php echo "$profile_id"; ?>?iframe=true&height=260" rel="prettyPhoto[1]">Link<

我正试图在我的登录脚本中插入一段代码。如果用户帐户是一种特殊类型,我希望它重定向到另一个url

这一点我知道怎么做。但我希望url窗口在我网站上的一个漂亮的照片框中打开。这是一种css框iframe窗口。我的大部分链接都是通过使用以下代码打开的:

<a href="something.php?to=<?php echo "$profile_id"; ?>?iframe=true&height=260"   rel="prettyPhoto[1]">Link</a>

但是当我尝试为我的重定向函数这样做时,它将不起作用。有人能告诉我为什么会这样吗?我输入的代码如下:

function redirect_to( $location = NULL ) {
        if ($location != NULL) {
            header("Location: {$location}");
            exit;
        }
    }


 <?php

$account_type = account_type();
while ($acctype = mysql_fetch_array($account_type)) 


 if ($acctype['account_type'] == 'free_member')  {
    redirect_to("chatboard.php?iframe=true&height=260\" rel=\"prettyPhoto[1]\""); 
 }

 ?>
函数重定向到($location=NULL){
如果($location!=NULL){
标题(“位置:{$Location}”);
出口
}
}

好的,有几件事我不确定你是如何设置的,但这就是它应该如何设置的

 <?php


function redirect_to( $location = NULL ) {
    if ($location != NULL) {
        header("Location: {$location}");
        exit;
    }
}



$account_type = account_type();
while ($acctype = mysql_fetch_array($account_type)){


  if ($acctype['account_type'] == 'free_member')  {
     redirect_to('chatboard.php?iframe=true&height=260&rel=' . $prettyPhoto[1]); 
    }
}

?>

并在chatboard.php上检查适当的变量,确保它们也被清除,不受可能的攻击