[英]How to redirect once user is logged in?
I have a secure zone log in form. 我有一个安全区域登录表单。 These normally get processed then the user is taken to a specific page that is the landing page for the secure zone. 这些通常会被处理,然后用户被带到特定页面,该页面是安全区域的登录页面。 I would like to change the log in form so that it logs them in the same way, but allows me to redirect them to a different page. 我想更改登录表单,以便以相同的方式记录它们,但允许我将它们重定向到不同的页面。 How can I use javascript to accomplish this? 我怎样才能用javascript来完成这个? The reason for doing this is that I have almost 3000 subscribers to this secure zone and don't want to have to duplicate them for a different secure zone. 这样做的原因是我有近3000个订阅者到这个安全区域,并且不想为不同的安全区域复制它们。 Any help is greatly appreciated. 任何帮助是极大的赞赏。
html form: HTML格式:
<form name="catseczoneform74513" onSubmit="return checkWholeForm74513(this)" method="post" action="https://redlakewalleye.worldsecuresystems.com/ZoneProcess.aspx?ZoneID=12369&Referrer={module_siteUrl,true,true}&OID={module_oid}&OTYPE={module_otype}">
<div class="form">
<div class="item">
<label for="SZUsername">Username</label><br />
<input class="cat_textbox_small" type="text" name="Username" id="SZUsername" maxlength="255" />
</div>
<div class="item">
<label for="SZPassword">Password</label><br />
<input class="cat_textbox_small" type="password" name="Password" id="SZPassword" maxlength="255" autocomplete="off" />
</div>
<div class="item">
<input type="checkbox" name="RememberMe" id="RememberMe" /><label for="RememberMe">Remember Me</label>
</div>
<div class="item">
<input class="cat_button" type="submit" value="Log in" /> <a href="/_System/SystemPages/PasswordRetrieveRequest">Lost password?</a>
</div>
</div>
<script type="text/javascript" src="/CatalystScripts/ValidationFunctions.js"></script>
<script type="text/javascript">
//<![CDATA[
function checkWholeForm74513(theForm){var why = "";if (theForm.Username) why += isEmpty(theForm.Username.value, "Username");if (theForm.Password) why += isEmpty(theForm.Password.value, "Password");if (why != ""){alert(why);return false;}theForm.submit();return false;}
//]]>
</script>
</form>
To redirect a user to a different location with javascript, use the following: 要使用javascript将用户重定向到其他位置,请使用以下命令:
window.location.href = "http://www.example.com";
As stated here , an alternate method is as follows: 如所陈述在这里 ,另一种方法如下:
window.location.replace("http://stackoverflow.com");
The first emulates the behavior of clicking on a link, the other acts as a HTTP redirect. 第一个模拟点击链接的行为,另一个模拟HTTP重定向。
你可以使用document.location.href = "link";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.