| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 579 人关注过本帖
标题:asp实现用户权限的问题
只看楼主 加入收藏
howema
Rank: 1
等 级:新手上路
帖 子:336
专家分:0
注 册:2005-10-4
结帖率:50%
收藏
 问题点数:0 回复次数:2 
asp实现用户权限的问题

前天发了一帖,问题还是没有解决。
要实现的效果:用户用ie输入服务器地址,回车,首先进入登陆页面--mylogin.asp,输入用户名和密码,若正确则跳转到服务器默认页面--default.asp,不正确则提示。
我搞了两天,还是不能实现这种效果,问题1.mylogin.asp访问时是乱码,2.不能实现正常跳转。
下面是mylogin.asp的源码: 希望高手赐教,给出详细说明最好。谢谢了先!!

<html><head><title>用户登录</title>
<script language="javascript">
function check(){
var checkuser=window.document.f.username.value;
var checkpwd=window.document.f.password.value;

if((checkuser=="admin")&(checkpwd=="1234")){

Response.Redirect("default.asp");
}
else
{
Response.Redirect("mylogin.asp");
}
}
</script>
</head>
<body>
<font style="font-size:11pt" >请输入登录用户名与口令</font><br>
<form name="f"action="mylogin.asp" method="post">
<br>用户名称:<input type="text" name="username">
<br>用户口令:<input type="password" name="password">
<br><input type="submit" value="登录" onclick="check()">
</form>
</body></html>

搜索更多相关主题的帖子: 权限 asp 用户 
2006-08-17 14:18
dreame
Rank: 3Rank: 3
等 级:新手上路
威 望:8
帖 子:521
专家分:0
注 册:2005-10-23
收藏
得分:0 
Response.Redirect是asp语法,不能在js中用的,可以换为window.location="default.asp";
乱码问题,只要设置页面编码<title>前
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">看看

有时候真的想放弃寂寞的等待,但她是那么的可爱!I love u forever!
2006-08-19 12:32
sunangel
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2006-8-14
收藏
得分:0 
登录框:
<html>
<head>
<title>登录框</title>
<script language="vbscript">
sub button_onClick()
dim uname,upass
uname=document.form1.username.value
upass=document.form1.passwords.value
if(uname="abc" and upass="123")then
msgbox"登录成功"
else
if(uname="")then
msgbox"用户名不能为空"
else
if(uname<>"abc")then
msgbox"用户名错误"
else
if(upass="")then
msgbox"密码不能为空"
else
if(upass<>"123")then
msgbox"密码错误"
end if
end if
end if
end if
end if
end sub
</script>
</head>
<body>
<form name="form1">
用户名:<input name="username" type="text" id="username" value="请输入用户名" onFocus=this.value="" >
密码:<input name="passwords" type="password" id="passwords">
<input type="submit" name="button" value="登录" onClick="button_onClick">
<input type="reset" name="Submits" value="重置">
</form>
</body>
</html>

2006-08-22 23:51
快速回复:asp实现用户权限的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014279 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved