Header location open into a new window?
| From: | Justin Wilkins | Date: | Sun, 12 Dec 2004 05:31:00 +0000 |
| Subject: | Header location open into a new window? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-204090@lists.php.net to get a copy of this message | ||
Is there a way in the current code below to make my $go_to_address go to a
webpage in a new link -- instead of embedded in an iframe?
In others words, can Header(Location: open in a new window?
<?
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly..."); }
if(!IsSet($mainfile)) { include ("mainfile.php"); }
/* get current user online whether they are registered user or just visitor
*/
/* we need global variables belong to PHP-Nuke */ global $user, $anonymous;
$users = $user;
/* init our variables */
$userid = 1;
$username = $anonymous;
/* check if registered user online */
if (is_user($users))
{
if (!is_array($users))
{
$user_cookie = explode(':', addslashes(base64_decode($users)));
$userid = $user_cookie[0];
$username = $user_cookie[1];
unset($user_cookie);
}
else
{
$userid = $users[0];
$username = $users[1];
}
$userid = (preg_match('/^[0-9]+$/', $userid)) ? intval($userid) : 1;
$username = (preg_match('/^[a-z0-9_-]+$/i', $username)) ? $username :
$anonymous;
}
/* construct a link (for registered user) */ if ($userid > 1) {
$content =
'https://swww.google.com/servlet/com.google.framework.servlets.BGSeamlessLog
in?STYLESHEETURL=google&PREFID='.rawurlencode($username).'';
}
else
{
$content2 = 'modules.php?name=form_joinpp'; }
/* clean unnecessary variables, to keep memory usage as low as possible */
unset($userid); unset($username);
/* all done. we provide $content variable to block handler */
$index=0;
$theme="4July";
//////TEST
$url_for_anonymous = $content2;
/////TEST
if (is_user($user)) {
$go_to_address1=$content;
$go_to_address=rawurldecode($go_to_address1);
include("header.php");
OpenTable3();
echo "<center><h4><a href=\"index.php\">Click Here to Return to the
Main
Menu</a></h4></center>"; echo "<iframe
SRC=\"".$go_to_address."\"
width=\"100%\" height=\"1200\"
framespacing=0 frameborder=no border=0 scrolling=auto></iframe>"; echo
"<br><center></center><br>"; } else {
header("Location:".$content2.""); }
CloseTable3();
include("footer.php");
die;
?>