高分求救 一经解决 马上给分

adventurezl 2003-10-18 04:37:27
根据用户输入的用户名和密码,到数据库中验证是否为合法用户,若是,则转入main2.asp页面,否则转入login_error.asp。为什么随便输用户名和密码(数据库中不存在),都只是在原先的页面??
主要代码如下:
main.asp
<%
dim username,password
username=trim(Request.form("username"))
password=trim(Request.form("password"))

if (username<>"") and (password<>"") then
dim conn,rs,SQL
set conn=Server.CreateObject("adodb.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq="& Server.MapPath("data/ancoson.mdb")
SQL="select * from CustomerInfo where Username='"&username&"' and Password='"&password&"'"
set rs=Server.CreateObject("adodb.Recordset")
rs.open SQL,conn,1,1

if rs.recordcount<1 then
Response.redirect "login_error.asp"
end if
if rs.recordcount>=1 then
Response.redirect "main2.asp"
end if
conn.close
rs.close
end if
%>

登陆的图片是这样的:
<td height="25" valign="bottom" background="images/main39_3.jpg"><img src="images/spacer.gif" width="16" height="15"><a href="main.asp"><img src="images/form_login.jpg" width="42" height="18" border="0" onclick="checkform()"></a></td>
...全文
97 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
qdubit 2003-10-18
  • 打赏
  • 举报
回复
偶花时间看了看前面的回答,已经很全面了,就不多说了!
1蓝天1 2003-10-18
  • 打赏
  • 举报
回复
学习
zhang_luo 2003-10-18
  • 打赏
  • 举报
回复
不是吧 ,搞的这么复杂干嘛
你随便输入的用户名和密码,查询数据库,当然就没有记录了
也就是只执行到
if rs.recordcount<1 then
Response.redirect "login_error.asp"
end if
这里就不执行了
你写这两个判断的时候最好用
if ………………then
………………
else
…………
end if
省事
还有就是在信息录入页面加上楼上那位兄弟说的检查check(form)
也就不用判断是否为空了
然后只要查询数据库里有没有这条记录,如果为空就转到error.asp就是了
zorou_fatal 2003-10-18
  • 打赏
  • 举报
回复
enctype="multipart/form-data"
表单以二进制数据的方式传送过去.
BrightEye 2003-10-18
  • 打赏
  • 举报
回复
有没有提示什么错误?从数据库连接开始检查...
main2.asp的代码呢?是不是形成了循环?
adventurezl 2003-10-18
  • 打赏
  • 举报
回复
TO angelheavens
可以了
enctype="multipart/form-data" 是什么意思?
马上送分
adventurezl 2003-10-18
  • 打赏
  • 举报
回复
</td>
<td rowspan=4> <img src="images/main_35.jpg" width=49 height=69></td>
<td colspan=4 rowspan=2 bgcolor="c8c8c8">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="52" class="9999">
<tr>
<td class="font9"><img src="images/blank.gif" width="18" height="6"><font color="#ffffff"><img src="images/arrow1.gif" width="3" height="7"><font color="#FFFFFF"><img src="images/blank.gif" width="5" height="6"></font></font><a href="about/about.htm">公司简介</a></td>
</tr>
<tr>
<td class="font9"><img src="images/blank.gif" width="26" height="8"><font color="#FFFFFF"><img src="images/arrow2.gif" width="3" height="7"><img src="images/blank.gif" width="5" height="6"></font><a href="jobs/jobs.htm">诚聘英才</a></td>
</tr>
<tr>
<td class="font9"><img src="images/blank.gif" width="26" height="8"><font color="#FFFFFF"><img src="images/arrow2.gif" width="3" height="7"><img src="images/blank.gif" width="5" height="6"></font><a href="about/about.htm">最新活动</a></td>
</tr>
</table>
</td>
<td rowspan=2> <img src="images/main_38.jpg" width=12 height=52></td>
<td height="40"> <img src="images/spacer.gif" width=1 height=40></td>
</tr>
<tr>
<td> <img src="images/spacer.gif" width=1 height=12></td>
</tr>
<tr>
<td colspan=5 rowspan=3> <img src="images/main_40.jpg" width=119 height=51></td>
<td colspan=6 rowspan=3 valign="bottom"><img src="images/main_39.jpg" width="206" height="51"></td>
<td> <img src="images/spacer.gif" width=1 height=5></td>
</tr>
<tr>
<td colspan=7 rowspan=2> <img src="images/main_41.jpg" width=135 height=46></td>
<td> <img src="images/spacer.gif" width=1 height=12></td>
</tr>
<tr>
<td colspan=5> <img src="images/main_42.jpg" width=138 height=34></td>
<td colspan=7> <img src="images/main_43.jpg" width=155 height=34></td>
<td> <img src="images/spacer.gif" width=8 height=34></td>
</tr>
<tr>
<td colspan=16> <img src="images/main_44.jpg" width=353 height=101></td>
<td colspan=11 rowspan=2> <img src="images/main_45.jpg" width=277 height=102></td>
<td colspan=3 rowspan=3> <img src="images/main_46.jpg" width=123 height=103></td>
<td> <img src="images/spacer.gif" width=1 height=101></td>
</tr>
<tr>
<td colspan=2 rowspan=4> <img src="images/main_47.jpg" width=93 height=70></td>
<td colspan=14 rowspan=2> <img src="images/main_48.jpg" width=260 height=2></td>
<td> <img src="images/spacer.gif" width=1 height=1></td>
</tr>
<tr>
<td colspan=11> <img src="images/main_49.jpg" width=277 height=1></td>
<td> <img src="images/spacer.gif" width=1 height=1></td>
</tr>
<tr>
<td colspan=27> <img src="images/main_50.jpg" width=621 height=43></td>
<td rowspan=2> <img src="images/main_51.jpg" width=39 height=68></td>
<td> <img src="images/spacer.gif" width=1 height=43></td>
</tr>
<tr>
<td colspan=27 class="main" align="center"><font color="#333333">Copyright
2003 Ancoson Corporation © . Powered by redix ©</font> </td>
<td> <img src="images/spacer.gif" width=1 height=25></td>
</tr>
</table>
<p> </p>
</form>
<script language=javascript>
function checkform()
{
if (document.form1.username.value=="")
{
alert("请输入用户名");
document.form1.username.focus();
return false;
}
if (document.form1.password.value=="")
{
alert("请输入密码");
document.form1.password.focus();
return false;
}
document.form1.submit();
}
</script>
</body>
</html>
angelheavens 2003-10-18
  • 打赏
  • 举报
回复
因为只处理文本数据,所以应把<form action="main.asp" method="post" enctype="multipart/form-data" name="form1" >改成:
<form action="main.asp" method="post" name="form1" >
adventurezl 2003-10-18
  • 打赏
  • 举报
回复
</td>
<td colspan=2 rowspan=2 valign="top" background="images/main12_bk.jpg"><img src="images/main_12.jpg" width="48" height="170"> </td>
<td height="21"> <img src="images/spacer.gif" width=1 height=102></td>
</tr>
<tr>
<td colspan=4 rowspan="2"> <a href="product/dv3000_1.htm"><img src="images/main_13.jpg" width=106 height=68 border="0"></a></td>
<td colspan=5 rowspan="2"> <a href="product/portable_1.htm"><img src="images/main_14.jpg" width=110 height=68 border="0"></a></td>
<td colspan=6 rowspan=2> <a href="product/d30_1.htm"><img src="images/main_15.jpg" width=113 height=69 border="0"></a></td>
<td colspan=5 rowspan=2> <a href="product/v56l_1.htm"><img src="images/main_16.jpg" width=111 height=69 border="0"></a></td>
<td colspan=4 rowspan=2> <a href="product/mdc4000_1.htm"><img src="images/main_17.jpg" width=107 height=69 border="0"></a></td>
<td height="21"> <img src="images/spacer.gif" width=1 height=68></td>
</tr>
<tr>
<td height="12" colspan="6" valign="top"><img src="images/main39_2.jpg" width="206" height="12"></td>
<td> <img src="images/spacer.gif" width=1 height=12></td>
</tr>
<tr>
<td height="25" colspan=24> <img src="images/main_23.jpg" width=547 height=25></td>
<td colspan="6" rowspan="3" valign="bottom" background="images/main39_3.jpg"><table width="206" height="2" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table> <table width="206" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25" valign="bottom" background="images/main39_3.jpg"><img src="images/spacer.gif" width="15" height="15"><img src="images/form_name.jpg" width="40" height="12">
<input name="username" type="text" style="font-family:Verdana,Arial; font-size: 9pt; color: #83A3CA; background-color: #FFFFFF; border-color: #ffffff; border-width: 0px; border-style: none" size="17" maxlength="30"></td>
</tr>
<tr>
<td height="25" valign="bottom" background="images/main39_3.jpg"><img src="images/spacer.gif" width="15" height="15"><img src="images/form_pass.jpg" width="40" height="12">
<input name="password" type="password" style="font-family:Verdana,Arial; font-size: 9pt; color: #83A3CA; background-color: #FFFFFF; border-color: #ffffff; border-width: 0px; border-style: none" size="17" maxlength="30"> </td>
</tr>
<tr>
<td height="25" valign="bottom" background="images/main39_3.jpg"><img src="images/spacer.gif" width="16" height="15"><input name="ok" type="image" src="images/form_login.jpg" width="42" height="18" border="0" onclick="checkform()"><a href="agreement.asp"><img src="images/form_new.jpg" width="70" height="18" border="0"></a><a href="lost.asp"><img src="images/form_forget.jpg" width="58" height="18" border="0"></a></td>
</tr>
</table>

</td>
<td> <img src="images/spacer.gif" width=1 height=25></td>
</tr>
<tr>
<td rowspan=3> <img src="images/main_24.jpg" width=9 height=57></td>
<td colspan=4 rowspan=3 bgcolor="82a1cf">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="57" class="9999">
<tr>
<td><img src="images/blank.gif" width="10" height="6"><img src="images/arrow1.gif" width="3" height="7"><img src="images/blank.gif" width="5" height="6"><a href="product/product.htm" class="font9">产品介绍</a></td>
</tr>
<tr>
<td><img src="images/blank.gif" width="18" height="8"><img src="images/arrow2.gif" width="3" height="7"><img src="images/blank.gif" width="5" height="6"><a href="product/dv3000_1.htm" class="font9">数码影像产品</a></td>
</tr>
<tr>
<td><img src="images/blank.gif" width="18" height="8"><img src="images/arrow2.gif" width="3" height="7"><img src="images/blank.gif" width="5" height="6"><a href="product/v56l_1.htm" class="font9">家庭影音产品</a></td>
</tr>
</table>
</td>
<td colspan=2 rowspan=3> <img src="images/main_27.jpg" width=19 height=57></td>
<td rowspan=4> <img src="images/main_28.jpg" width=15 height=69></td>
<td colspan=3 rowspan=4 bgcolor="c8c8c8">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="69" class="9999">
<tr>
<td class="font9" valign="middle"><img src="images/blank.gif" width="14" height="6"><font color="#666666"><img src="images/arrow1.gif" width="3" height="7"><font color="#FFFFFF"><img src="images/blank.gif" width="5" height="6"></font></font><a href="client/client.htm" class="font9">客户服务</a></td>
</tr>
<tr>
<td class="font9" valign="middle"><img src="images/blank.gif" width="22" height="8"><font color="#FFFFFF"><img src="images/arrow2.gif" width="3" height="7"><img src="images/blank.gif" width="5" height="6"></font><a href="client/client_fuwu.htm">服务理念</a></td>
</tr>
<tr>
<td class="font9" valign="middle"><img src="images/blank.gif" width="22" height="8"><font color="#FFFFFF"><img src="images/arrow2.gif" width="3" height="7"><img src="images/blank.gif" width="5" height="6"></font><a href="client/client_daili.htm">授权代理</a></td>
</tr>
<tr>
<td class="font9" valign="middle"><img src="images/blank.gif" width="22" height="8"><font color="#FFFFFF"><img src="images/arrow2.gif" width="3" height="7"><img src="images/blank.gif" width="5" height="6"></font><a href="client/client_lianxi.htm">联系我们</a></td>
</tr>
</table>
</td>
<td colspan=2 rowspan=4> <img src="images/main_31.jpg" width=33 height=69></td>
<td rowspan=4> <img src="images/main_32.jpg" width=10 height=69></td>
<td colspan=4 rowspan=4 bgcolor="c8c8c8">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="69" class="9999">
<tr>
<td class="font9" valign="middle"><img src="images/blank.gif" width="13" height="6"><font color="#666666"><img src="images/arrow1.gif" width="3" height="7"><font color="#FFFFFF"><img src="images/blank.gif" width="5" height="6"></font></font><a href="support/support_digi.html">技术支持</a></td>
</tr>
<tr>
<td class="font9" valign="middle"><img src="images/blank.gif" width="19" height="8"><font color="#FFFFFF"><img src="images/arrow2.gif" width="3" height="7"><img src="images/blank.gif" width="5" height="6"></font><a href="support/support_digi.html">维修站</a></td>
</tr>
<tr>
<td class="font9" valign="middle"><img src="images/blank.gif" width="19" height="8"><font color="#FFFFFF"><img src="images/arrow2.gif" width="3" height="7"><img src="images/blank.gif" width="5" height="6"></font><a href="support/skill.html">使用技巧</a></td>
</tr>
<tr>
<td class="font9" valign="middle"><img src="images/blank.gif" width="19" height="8"><font color="#FFFFFF"><img src="images/arrow2.gif" width="3" height="7"><img src="images/blank.gif" width="5" height="6"></font><a href="support/support_digi.html">驱动下载</a></td>
</tr>
</table>
adventurezl 2003-10-18
  • 打赏
  • 举报
回复
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<form name="form2" method="post" action="">
</form>
<form action="main.asp" method="post" enctype="multipart/form-data" name="form1" >
<table width=753 border=0 cellpadding=0 cellspacing=0 align="center">
<tr>
<td> <img src="images/spacer.gif" width=9 height=1></td>
<td> <img src="images/spacer.gif" width=84 height=1></td>
<td> <img src="images/spacer.gif" width=3 height=1></td>
<td> <img src="images/spacer.gif" width=10 height=1></td>
<td> <img src="images/spacer.gif" width=10 height=1></td>
<td> <img src="images/spacer.gif" width=9 height=1></td>
<td> <img src="images/spacer.gif" width=10 height=1></td>
<td> <img src="images/spacer.gif" width=15 height=1></td>
<td> <img src="images/spacer.gif" width=66 height=1></td>
<td> <img src="images/spacer.gif" width=17 height=1></td>
<td> <img src="images/spacer.gif" width=21 height=1></td>
<td> <img src="images/spacer.gif" width=19 height=1></td>
<td> <img src="images/spacer.gif" width=14 height=1></td>
<td> <img src="images/spacer.gif" width=10 height=1></td>
<td> <img src="images/spacer.gif" width=32 height=1></td>
<td> <img src="images/spacer.gif" width=24 height=1></td>
<td> <img src="images/spacer.gif" width=18 height=1></td>
<td> <img src="images/spacer.gif" width=8 height=1></td>
<td> <img src="images/spacer.gif" width=49 height=1></td>
<td> <img src="images/spacer.gif" width=12 height=1></td>
<td> <img src="images/spacer.gif" width=2 height=1></td>
<td> <img src="images/spacer.gif" width=76 height=1></td>
<td> <img src="images/spacer.gif" width=17 height=1></td>
<td> <img src="images/spacer.gif" width=12 height=1></td>
<td> <img src="images/spacer.gif" width=28 height=1></td>
<td> <img src="images/spacer.gif" width=19 height=1></td>
<td> <img src="images/spacer.gif" width=36 height=1></td>
<td> <img src="images/spacer.gif" width=75 height=1></td>
<td> <img src="images/spacer.gif" width=9 height=1></td>
<td> <img src="images/spacer.gif" width=39 height=1></td>
<td></td>
</tr>
<tr>
<td colspan=6> <img src="images/main_01.jpg" width=125 height=34></td>
<td colspan=20 rowspan=2> <img src="images/main_02.jpg" width=469 height=35></td>
<td colspan=4 rowspan=3> <img src="images/main_03.jpg" width=159 height=36></td>
<td> <img src="images/spacer.gif" width=1 height=34></td>
</tr>
<tr>
<td colspan=6> <img src="images/main_04.jpg" width=125 height=1></td>
<td> <img src="images/spacer.gif" width=1 height=1></td>
</tr>
<tr>
<td colspan=24> <img src="images/main_05.jpg" width=547 height=1></td>
<td colspan=2> <img src="images/main_06.jpg" width=47 height=1></td>
<td> <img src="images/spacer.gif" width=1 height=1></td>
</tr>
<tr>
<td colspan=24 rowspan=2 align="left" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="3" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="530" height="124">
<param name="movie" value="images/banner.swf">
<param name="quality" value="high">
<embed src="images/banner.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="530" height="124"></embed></object></td>
<td><A onmouseover="scroll('down',10)" onmouseout="out('up')" href="javascript:;"><img src="images/main2_02.jpg" width="17" height="26" border=0></a></td>
</tr>
<tr>
<td><A onmouseover="scroll('up',10)" onmouseout="out('up')" href="javascript:;"><img src="images/main2_03.jpg" width="17" height="21" border=0></a></td>
</tr>
<tr>
<td><img src="images/main2_04.jpg" width="17" height="77"></td>
</tr>
</table>
</td>
<td colspan=6> <img src="images/main_09.jpg" width=206 height=22></td>
<td> <img src="images/spacer.gif" width=1 height=22></td>
</tr>
<tr>
<td rowspan=2 valign="top" background="images/main10_bk.jpg"><img src="images/main_10.jpg" width="28" height="170"> </td>
<td colspan=3 rowspan=2 valign="top" bgcolor="a6c0d8"><table width="130" border="0" cellspacing="0" cellpadding="0" height="26">
<tr>
<td align="center" valign="top" bgcolor="#A6C0D8" class="main"><img src="images/news.jpg" width="75" height="15"></td>
</tr>
</table>
<MARQUEE id=scrolltext onmouseover=this.stop()
onmouseout=this.start() scrollAmount=1 scrollDelay=60
direction=up width=130 height=140 name="scrolltext">
<table width="130" height="144" border="0" cellpadding="0" cellspacing="0" bgcolor="a6c0d8" class="main2">
<tr>
<td align="center"> <font color="#333333"><a href="#" onClick="MM_openBrWindow('pop2.htm','','scrollbars=yes,width=255,height=350')">Ancoson
DV4000<br>
新品上市</a></font></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center"><font color="#333333"><a href="#" onClick="MM_openBrWindow('pop3.htm','','scrollbars=yes,width=255,height=350')">安克森四百万像素的<br>
手掌型DV4000</a></font></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center"><font color="#333333"><a href="#" onClick="MM_openBrWindow('pop4.htm','','scrollbars=yes,width=255,height=350')">如何辨别真假DV4000</a></font></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center"><a href="#"><SPAN id=glowtext onClick="MM_openBrWindow('pop.htm','','width=255,height=350')">夏日劲爆数码风</span></a></td>
</tr>
<tr>
<td align="center"> <p><font color="#333333">买DV3000<br>
送超薄DVD影碟机</font></p></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td> <b><font color="#333333">买DV3000,+299元送超薄DVD影碟机”</font></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><b><font color="#333333">活动时间:</font></b></td>
</tr>
<tr>
<td><font color="#333333">2003年8月8日至2003年9月8日</font></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><b><font color="#333333">活动对象:</font></b></td>
</tr>
<tr>
<td><font color="#333333">湖北省内最终用户</font></td>
</tr>
<tr>
<td>  </td>
</tr>
<tr>
<td><b><font color="#333333">促销方式:</font></b></td>
</tr>
<tr>
<td> <font color="#333333">凡在8月8日至9月8日期间购买ANCOSON DV3000的用户, 均可享受“+299元送价值699元的超薄DVD影碟机”活动,每台仅限购一台,购买当日有效,过时不补。</font></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><font color="#333333">此次赠品超薄DVD影碟机仍由安克森公司承保,一年保修,详见机内的保修卡。</font></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</MARQUEE>
adventurezl 2003-10-18
  • 打赏
  • 举报
回复
只好贴出所有的源代码了
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<% @LANGUAGE = VBScript %>
<%

dim username,password
username=trim(Request.form("username"))
password=trim(Request.form("password"))

if (username<>"") and (password<>"") then
dim conn,rs,SQL
set conn=Server.CreateObject("adodb.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq="& Server.MapPath("data/ancoson.mdb")
SQL="select * from CustomerInfo where Username='"&username&"' and Password='"&password&"'"
set rs=Server.CreateObject("adodb.Recordset")
rs.open SQL,conn,1,1

if rs.recordcount<1 then
Response.redirect "login_error.asp"
end if
if rs.recordcount>=1 then
Response.redirect "main2.asp"
end if
conn.close
rs.close
end if
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT language=JavaScript src="java_script/roll.js"></SCRIPT>
<SCRIPT language=JavaScript src="java_script/Scroll.js"></SCRIPT>
<SCRIPT language=JavaScript src="java_script/flash.js"></SCRIPT>
<title>Ancoson 欢迎您</title>
<link rel="stylesheet" href="main" type="text/css">
<link rel="stylesheet" href="main.css" type="text/css">
<link rel="stylesheet" href="main2.css" type="text/css">
<link href="gray.css" rel="stylesheet" type="text/css">
<STYLE type=text/css>#glowtext {
FILTER: glow(color=blue,strength=5); WIDTH: 100%
}<!在这里改变颜色>
</STYLE>

<SCRIPT language=JavaScript1.2>
function glowit(which){
if (document.all.glowtext[which].filters[0].strength==2)
document.all.glowtext[which].filters[0].strength=1
else
document.all.glowtext[which].filters[0].strength=2
}
function glowit2(which){
if (document.all.glowtext.filters[0].strength==2)
document.all.glowtext.filters[0].strength=1
else
document.all.glowtext.filters[0].strength=2
}
function startglowing(){
if (document.all.glowtext&&glowtext.length){
for (i=0;i<glowtext.length;i++)
eval('setInterval("glowit('+i+')",150)')
}
else if (glowtext)
setInterval("glowit2(0)",150)
}
if (document.all)
window.onload=startglowing
</SCRIPT>








<!--head头部代码开始-->
<script language="JavaScript" SRC="moveobj.js"> </script>
<script>
<!--

var chip1;
//根据使用的图片的多少增加或减少上面相应代码;

function pagestart()
{checkbrOK();
chip1=new Chip("chip1",60,80);
//根据使用的图片的多少增加或减少上面的相应代码
if(brOK)
{ movechip("chip1");
//根据使用的图片的多少增加或减少上面的相应代码
}
}
//-->
</script>
<!--代码结束-->

<script language="JavaScript" type="text/JavaScript">
<!--

function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_timelinePlay(tmLnName, myID) { //v1.2
//Copyright 1997, 2000 Macromedia, Inc. All rights reserved.
var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
tmLn = document.MM_Time[tmLnName];
if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
if (myID == tmLn.ID) { //if Im newest
setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
fNew = ++tmLn.curFrame;
for (i=0; i<tmLn.length; i++) {
sprite = tmLn[i];
if (sprite.charAt(0) == 's') {
if (sprite.obj) {
numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
keyFrm=1;
for (j=0; j<sprite.values.length; j++) {
props = sprite.values[j];
if (numKeyFr != props.length) {
if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
else sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
} else {
while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
else sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
} } } } }
} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
if (fNew > tmLn.lastFrame) tmLn.ID = 0;
} }
}

function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0
//Copyright 1997, 2000 Macromedia, Inc. All rights reserved.
var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
tmLn = document.MM_Time[tmLnName];
if (numGotos != null)
if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
jmpFwd = (fNew > tmLn.curFrame);
for (i = 0; i < tmLn.length; i++) {
sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back
if (sprite.charAt(0) == "s") {
numKeyFr = sprite.keyFrames.length;
firstKeyFr = sprite.keyFrames[0];
lastKeyFr = sprite.keyFrames[numKeyFr - 1];
if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd
for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
for (j=0; j<sprite.values.length; j++) {
props = sprite.values[j];
if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only
else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
if (sprite.obj != null) {
if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
else sprite.obj[props.prop2][props.prop] = props[propNum];
} }
} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
}
tmLn.curFrame = fNew;
if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
}
//-->
</script>
aBoris 2003-10-18
  • 打赏
  • 举报
回复
<script language=javascript>
function checkform()
{
if (document.form1.username.value=="")
{
alert("请输入用户名");
document.form1.username.focus();
return false;
}
if (document.form1.password.value=="")
{
alert("请输入密码");
document.form1.password.focus();
return false;
}
document.form1.submit();
}
</script>
aBoris 2003-10-18
  • 打赏
  • 举报
回复
sorry:document.form1.submit()
adventurezl 2003-10-18
  • 打赏
  • 举报
回复
to bzscs:我试过了,还是不行

<script language=javascript>
function checkform()
{
if (document.form1.username.value=="")
{
alert("请输入用户名");
document.form1.username.focus();
return false;
}
if (document.form1.password.value=="")
{
alert("请输入密码");
document.form1.password.focus();
return false;
}
}
</script>

aBoris 2003-10-18
  • 打赏
  • 举报
回复
<form name="form1" id="form1" action="main.asp" method="post">

<td height="25" valign="bottom" background="images/main39_3.jpg">
<img src="images/spacer.gif" width="16" height="15">
<a href="javascript:{checkform()}">
<img src="images/form_login.jpg" width="42" height="18" border="0"></a>
</td>
</form>
--------------------------------------------------------------------------
你的checkform()里再加上代码: document.form1.sumbmit()
swizard 2003-10-18
  • 打赏
  • 举报
回复
把以下这一部分
if rs.recordcount<1 then
Response.redirect "login_error.asp"
end if
if rs.recordcount>=1 then
Response.redirect "main2.asp"
end if
改为 if rs.eof then
response.redirect "login_error.asp"
else
response.redirect "main2.asp"
这样试试,不过有个前提是,你那个checkform()要定义正确才行
angelheavens 2003-10-18
  • 打赏
  • 举报
回复
username和password有值吗?你是如何提交呢?
ayuea 2003-10-18
  • 打赏
  • 举报
回复
最上面的代码是没有错的,错误可能出现再你的登录框那一块。<a href="main.asp">是什么意思?是不是main2
bzscs 2003-10-18
  • 打赏
  • 举报
回复
把<a href="main.asp"><img src="images/form_login.jpg" width="42" height="18" border="0" onclick="checkform()"></a>
改为<input type="image" scr="images/form_login.jpg" width="42" height="18" border="0" onclick="return checkform()">
pjchuqi 2003-10-18
  • 打赏
  • 举报
回复
checkform()怎么定义的函数?

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧