你的密码是放在那里呢!
sub command1_click()
if textbox.text<>"密码" and i<3 then
i=i+1
textbox.text=""
textbox.setfocus
exit sub
else
if textbox.text="密码" then
通过验证,进入主窗体
i=0
exit sub
end if
if i>=3 then
i=0
exit sub
unload form
end if
end ifend sub
sub command1_click()
if textbox.text<>"密码" and i<3 then
i=i+1
textbox.text=""
textbox.setfocus
exit sub
else
if textbox.text="密码" then
通过验证,进入主窗体
i=0
exit sub
end if
if i>=3 then
i=0
exit sub
unload form
end if
end ifend sub
这是登陆页面的一部分,也就是一个FORM
<input name="id" type="text" id="id">
<input name="password" type="password" id="password">
<input name="submit" type="submit" class="aa" id="submit3" value="登陆">
<INPUT name="button" type=button class="aa" onclick="window.location.href='luntan/registry.jsp'" value="注册">
</a>下面是验证页面的操作,也就是登陆后的页面:
<%
String password,id;
id=request.getParameter("id");
id=id.trim();
byte[] tmpbyte;
tmpbyte=id.getBytes("ISO8859_1");
id=new String(tmpbyte);password=request.getParameter("password");
ResultSet RS=conn.executeQuery("SELECT * FROM user WHERE username='"+id+"' and userpassword='"+password+"' ");
if(RS.next()==false)
{
out.println("<Script Language='JavaScript'>");
out.print("alert('登陆失败!");
out.println("请确认ID与Password!');");
out.println("history.back(-1);</Script>");
}
else
{out.print("<h1>登陆成功</h1>");}
%>
用了一个连接数据库的bean,name为conn,数据库中的表名为user
我的EMAIL:[email protected]
谢谢了。