代码如下,现保存为htm文件,提交的时候系统需要验证user_name user_pwd 和logintype 三个字段的内容,他们分别是 admin admin888 和 集团用户 ,请问如何实现打开这个htm文件,会直接进入系统页面,而不需要点击登录才跳转到系统页面?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-type" content="text/rhtml; charset=UTF-8" />
<html>
<head>
<title>自动登录</title>
</head>
<body id="login">
<div id="columns">
<div id="main">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><body>
<table id="main" align=center cellSpacing=0 cellPadding=0 width=652 bgColor=#00529c border=0>
<form name=form1 method="post" action="http://192.168.1.253:8080/tracking/login/user_login">
<tr>
<td align=right width=61 height=28><FONT color=#ffffff>用户名:</td>
<td width=126 ><label>
<input type="text" name="user_name" size="15" value="admin">
</label></td>
<td align=right width=45 height=28><FONT color=#ffffff>密码:</td>
<td width=120><input type="password" name="user_pwd" size="15" value="admin888"></td>
<!-- onchange="checkvalue(this.value)" -->
<td width="64">
<select name=LogInType>
<option value=PersonalUser>-个人用户-</option>
<option value=Corporation selected="selected">-集团用户-</option>
</select></td>
<td width="135"><input style="CURSOR: hand; COLOR: white; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: transparent; BORDER-BOTTOM-STYLE: none" type="submit"
value="登录" /> </td><td width="85"><input id="noexpires" name="noexpires" type="checkbox" /><span style="font-size:12px; color:#FFFFFF;">记住密码</span></td>
</tr>
</form>
</table>
</body>
</div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-type" content="text/rhtml; charset=UTF-8" />
<html>
<head>
<title>自动登录</title>
</head>
<body id="login">
<div id="columns">
<div id="main">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><body>
<table id="main" align=center cellSpacing=0 cellPadding=0 width=652 bgColor=#00529c border=0>
<form name=form1 method="post" action="http://192.168.1.253:8080/tracking/login/user_login">
<tr>
<td align=right width=61 height=28><FONT color=#ffffff>用户名:</td>
<td width=126 ><label>
<input type="text" name="user_name" size="15" value="admin">
</label></td>
<td align=right width=45 height=28><FONT color=#ffffff>密码:</td>
<td width=120><input type="password" name="user_pwd" size="15" value="admin888"></td>
<!-- onchange="checkvalue(this.value)" -->
<td width="64">
<select name=LogInType>
<option value=PersonalUser>-个人用户-</option>
<option value=Corporation selected="selected">-集团用户-</option>
</select></td>
<td width="135"><input style="CURSOR: hand; COLOR: white; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: transparent; BORDER-BOTTOM-STYLE: none" type="submit"
value="登录" /> </td><td width="85"><input id="noexpires" name="noexpires" type="checkbox" /><span style="font-size:12px; color:#FFFFFF;">记住密码</span></td>
</tr>
</form>
</table>
</body>
</div>
</div>
</body>
</html>
用 Response.Redirect(url);就行了。但是点击这个html页面,我如何自己是admin还是admin888登录的
<script>
location.href='系统页面.html';
</script>
如果是针对某一个人 某一台电脑 还不如在他的电脑客户端给设置好 比如直接保存cookie啥的,就像进入csdn自己直接打开就登陆了
服务器需要判断session的,现在就是想能够省去点击“登录”按钮的这个步骤,直接进入系统。
等待<span id="daojishi">10</span>秒后你将跳转到
<script type="text/javascript">
function daoshu(){
var djs = document.getElementById("daojishi");
if(djs.innerHTML == 0){
window.location.href='系统页面.htm';
return false;
}
djs.innerHTML = djs.innerHTML - 1;
}
window.setInterval("daoshu()", 1000);
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-type" content="text/rhtml; charset=UTF-8" />
<html>
<head>
<title>自动登录</title>
<script>
function submitForm(){
var frm = document.getElementById( "form1");
frm.submit();
}
</script>
</head>
<body id="login" onload= "submitForm(); ">
<div id="columns">
<div id="main">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><body>
<table id="main" align=center cellSpacing=0 cellPadding=0 width=652 bgColor=#00529c border=0>
<form name=form1 method="post" action="http://192.168.1.253:8080/tracking/login/user_login">
<tr>
<td align=right width=61 height=28><FONT color=#ffffff>用户名:</td>
<td width=126 ><label>
<input type="text" name="user_name" size="15" value="admin">
</label></td>
<td align=right width=45 height=28><FONT color=#ffffff>密码:</td>
<td width=120><input type="password" name="user_pwd" size="15" value="admin888"></td>
<!-- onchange="checkvalue(this.value)" -->
<td width="64">
<select name=LogInType>
<option value=PersonalUser>-个人用户-</option>
<option value=Corporation selected="selected">-集团用户-</option>
</select></td>
<td width="135"><input style="CURSOR: hand; COLOR: white; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: transparent; BORDER-BOTTOM-STYLE: none" type="submit"
value="登录" /> </td><td width="85"><input id="noexpires" name="noexpires" type="checkbox" /><span style="font-size:12px; color:#FFFFFF;">记住密码</span></td>
</tr>
</form>
</table>
</body>
</div>
</div>
</body>
</html>
登录使用ajax查询数据,判断是否符合再location.href
那你就保存到Session 后台 load事件验证得了呗
简单来说,现在用的是form提交,我想实现成为url提交登录