| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 461 人关注过本帖
标题:登陆问题--没有达到我预期的网页中去
只看楼主 加入收藏
271391233
Rank: 1
等 级:新手上路
帖 子:174
专家分:0
注 册:2005-2-24
收藏
 问题点数:0 回复次数:4 
登陆问题--没有达到我预期的网页中去

<!--#Include file="conn.asp"-->
<%
if Request("action")="login" Then
Function ReplaceBadWord(g_word)
'Replace(string,被搜索的子字符串,用于替换的子字符串)函数
'返回字符串,其中指定数目的某子字符串被替换为另一个子字符串
g_word=Replace(g_word,"'","")
g_word=Replace(g_word," ","")
g_word=Replace(g_word,"&","")
g_word=Replace(g_word,"(","")
g_word=Replace(g_word,"\","")
g_word=Replace(g_word,"/","")
g_word=Replace(g_word,"..","")
g_word=Replace(g_word,"^","")
g_word=Replace(g_word,"#","")
g_word=Replace(g_word,"%","")
g_word=Replace(g_word,"|","")
g_word=Replace(g_word,";","")
g_word=Trim(Replace(g_word,")",""))
ReplaceBadWord=g_word
End Function
'-----------------函数结束-------------

dim sql
dim rs
dim username
dim password
username=replace(trim(request("username")),"'","")
password=Request.form("password")'密码加密

On Error Resume Next'错误开启
sql="select count(*) as RECORDCOUNT from admin where username='"& username &"' and userpassword='"& userpassword &"'"
Set rs=conn.Execute("sql")
rcount=rs("RECORDCOUNT")
rs.close
conn.close
if rcount<1 then
%>
<script>
<!--
alert("用户不存在");
history.back();
-->
</script>
<%
else
response.Cookies("users")("username")=username
response.Cookies("users")("userpassword")=userpassword
response.Redirect"admin.asp?action=login"
end if
end if
%>
<html>
<head>
<title>【音乐系统】-【管理登陆】</title>
<style>
body { color: #12463b; FONT-FAMILY 宋体; font-size: 9pt }
td { color: #12463b; FONT-FAMILY 宋体; font-size: 9pt }
a { color: #12463b; font-size: 9pt; text-decoration: none }
a:hover { color: red; font-size: 9pt; text-decoration: none }
a.linkblue { color: #2222cc; font-size: 9pt; text-decoration: none }
a.linkgr { color: #666622; font-size: 9pt; text-decoration: none }
a.linkblue:hover { background-color: #000066; color: white; font-size: 9pt; text-decoration: none }

table {
font-size: 9pt;
}
input {
background-color: #FFFFFF;
border: 1px solid #CCCCCC;
}
</style>
</head>

<body background="skybg.gif" leftMargin=0 topMargin=0>
<br>
<br><br>
<TABLE height=350 cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR>
<TD >
<TABLE height=210 cellSpacing=0 cellPadding=0 width=307 align=center border=0>
<form method="get" action="?action=login" >
<TBODY>
<TR>
<TD background="images/dt2.jpg">
<TABLE cellSpacing=0 cellPadding=" " width=300 border=0>
<TBODY>
<TR>
<TD colSpan=2 height=50></TD></TR>
<TR>
<TD align=right width="35%" height=20><STRONG>用户名:</STRONG> </TD>
<TD width="65%" height=20><INPUT
style="BORDER-RIGHT: #004485 1px solid; BORDER-TOP: #004485 1px solid; FONT-SIZE: 10pt; BORDER-LEFT: #004485 1px solid; BORDER-BOTTOM: #004485 1px solid; BACKGROUND-COLOR: #d1ddeb"
maxLength=20 name="username" type="text" id="username"> </TD></TR>
<TR>
<TD align=right height=7></TD>
<TD height=7></TD>
</TR>
<TR>
<TD align=right height=20><STRONG>密 码:</STRONG></TD>
<TD height=20><INPUT
style="BORDER-RIGHT: #004485 1px solid; BORDER-TOP: #004485 1px solid; FONT-SIZE: 10pt; BORDER-LEFT: #004485 1px solid; BORDER-BOTTOM: #004485 1px solid; BACKGROUND-COLOR: #d1ddeb"
maxLength=20 name="password" type="password" class="input" id="password"> </TD></TR>
<TR>
<TD align=right height=10>&nbsp;</TD>
<TD height=10></TD></TR>
<TR align=middle>
<TD colSpan=2 height=16>
<HR width=270 color=#0a4d99 noShade SIZE=1>
</TD></TR>
<TR vAlign=top align=middle>
<TD colSpan=2 height=25><INPUT name="Submit" type=image height=15 width=38
src="images/bgoffice_12.gif" border=0>
&nbsp; <IMG onMouseOver="this.style.cursor='hand';"
onclick="form1.username.value='';form1.password.value='';"
height=15 src="images/bgoffice_13.gif" width=38 border=0>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></FORM></TABLE></TD></TR></TBODY></TABLE>
<p>&nbsp;&nbsp;</p><p>&nbsp;&nbsp;</p>
<p><CENTER><font color="#000000">╃Only音乐系统后台管理╃<br>Copyright &copy; 2006
<a href=http://www.only.com target=_blank>AnQR.NeT</a> Corporation. All Rights
Reserved <br> Designed By <a href="mailto:only@gmail.com">AnQR</a> &copy; 2006<br></font></CENTER></p>
<!--
'****************************************************

'****************************************************
-->
</body>
</html>

搜索更多相关主题的帖子: 网页 搜索 Request action 字符串 
2006-08-17 08:59
271391233
Rank: 1
等 级:新手上路
帖 子:174
专家分:0
注 册:2005-2-24
收藏
得分:0 
当我点登陆的时候网页跳到http://localhost/music/我能行/login.asp?username=admin&amp;password=admin&amp;Submit.x=-1&amp;Submit.y=-1这个页面中去了

我想在我点登陆的时候跳到http://localhost/music/我能行/admin.asp?action=login页面中去

坚持就是胜利>>静心,静思
2006-08-17 09:01
271391233
Rank: 1
等 级:新手上路
帖 子:174
专家分:0
注 册:2005-2-24
收藏
得分:0 
admin.asp页面

&lt;% if request("action")="login" then %&gt;
&lt;table width="750"  border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000"&gt;
&lt;tr bgcolor="#FFFFFF"&gt;
&lt;td align="center" width="30"&gt;ID
&lt;/td&gt;
&lt;td width="100"&gt;歌手名字
&lt;/td&gt;
&lt;td width="160"&gt;歌曲名称
&lt;/td&gt;
&lt;td width="100"&gt;歌曲分类
&lt;/td&gt;
&lt;td width="60"&gt;歌曲类型
&lt;/td&gt;
&lt;td width="40" align="center"&gt;试听
&lt;/td&gt;
&lt;td width="40" align="center"&gt;下载
&lt;/td&gt;
&lt;td width="40" align="center"&gt;报错
&lt;/td&gt;
&lt;td width="30" align="center"&gt;推荐
&lt;/td&gt;
&lt;td width="30" align="center"&gt;置顶
&lt;/td&gt;
&lt;td align="center"&gt;编辑与删除
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="#FFFFFF"&gt;
&lt;td align="right"&gt;&amp;nbsp;
&lt;/td&gt;
&lt;td&gt;&amp;nbsp;
&lt;/td&gt;
&lt;td&gt;&amp;nbsp;
&lt;/td&gt;
&lt;td&gt;&amp;nbsp;
&lt;/td&gt;
&lt;td&gt;&amp;nbsp;
&lt;/td&gt;
&lt;td align="center"&gt;&amp;nbsp;
&lt;/td&gt;
&lt;td align="center"&gt;&amp;nbsp;
&lt;/td&gt;
&lt;td align="center"&gt;


&lt;/td&gt;
&lt;td align="center"&gt;&amp;nbsp;
&lt;/td&gt;
&lt;td align="center"&gt;
&lt;font color=red&gt;是&lt;/font&gt;

&lt;/td&gt;
&lt;td align="center"&gt;&lt;a href="admin.asp?edit=edit&amp;id=&lt;%%&gt;"&gt;编辑与删除&lt;/a&gt;
&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;table width="750"  border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000"&gt;
  &lt;tr bgcolor="#FFFFFf"&gt;
    &lt;td colspan="11"&gt;&amp;nbsp;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;% end if %&gt;

坚持就是胜利>>静心,静思
2006-08-17 09:03
弯曲的直线
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2006-7-21
收藏
得分:0 
rcount=rs("RECORDCOUNT")

试着改成=rs.recordcount

上论坛感觉就象和人拼贴子
2006-08-17 17:53
271391233
Rank: 1
等 级:新手上路
帖 子:174
专家分:0
注 册:2005-2-24
收藏
得分:0 
还是一样啊
郁闷~!~

坚持就是胜利>>静心,静思
2006-08-18 20:20
快速回复:登陆问题--没有达到我预期的网页中去
数据加载中...
 
   



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

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