Javascript 重定向到新窗口
我使用了一个登录脚本(没什么特别的),它会导致一个小的成员区域——我想知道是否有可能更改这个脚本,以便在提交用户凭据后,在新窗口中打开受限区域 下面是我的代码示例:Javascript 重定向到新窗口,javascript,php,jquery,prettyphoto,Javascript,Php,Jquery,Prettyphoto,我使用了一个登录脚本(没什么特别的),它会导致一个小的成员区域——我想知道是否有可能更改这个脚本,以便在提交用户凭据后,在新窗口中打开受限区域 下面是我的代码示例: <?php define("_VALID_PHP", true); require_once("init.php"); if ($user->logged_in) redirect_to("welcome.php"); if (isset($_P
<?php
define("_VALID_PHP", true);
require_once("init.php");
if ($user->logged_in)
redirect_to("welcome.php");
if (isset($_POST['doLogin']))
: $result = $user->login($_POST['username'], $_POST['password']);
if ($result)
: redirect_to("welcome.php");
endif;
endif;
?>
以下是表格:
<form action="" method="post" id="login_form" name="login_form">
<h1>Login</h1>
<div style="text-align:center; color:#F00; margin-bottom:20px;" id="msgholder-alt"><?php print $core->showMsg;?></div>
<p>
<label for="username" class="uname" > Your Username:</label>
<input id="username" name="username" required type="text" />
</p>
<p>
<label for="password" class="youpasswd"> Your Password: </label>
<input id="password" name="password" required type="password" />
</p>
<p class="login button">
<input type="submit" value="Login" name="submitlogin" />
<input name="doLogin" type="hidden" value="1" />
</p>
</form>
登录
您的用户名:
您的密码:
非常感谢您的帮助,谢谢 您可以使用一些JavaScript打开新页面(为弹出窗口拦截器做好准备)。但是,登录页面呢?最好的方法就是你现在所拥有的。谢谢你给Dave Chen的消息-问题是我已经在一个Prettypto iframe中加载了索引页面(包含登录表单)。一旦我提交了详细信息,限制区(welcome.php)就可以在这个iframe中看到。我想改变这一点,这样一旦提交了用户名和密码,welcome.php页面就会在一个新窗口中打开。有没有办法做到这一点?为什么不影响父帧呢
window.top.location.href='welcome.php'代码>我需要在哪里添加此代码?对不起,我忘了提到,这是JavaScript<代码>echo'window.top.location.href=“welcome.php”;退出代码>