基于用户的新闻系统!之六
申请帐号后登陆的文件!登陆文件之二
文件名:chklogin.jsp
<%@page contentType="text/html;charset=gb2312" %>
<%@ include file=
"inc.jsp" %>
<%@ include file=
"myDate.jsp"%>
<%
String uID=request.getParameter(
"UID");
String password=request.getParameter(
"password");
String sql=
"select * from pmusers where uID='"+uID+"'and password='"+password+"'";
ResultSet rs=apple.select(sql);
if(rs.next())
{
String gender= rs.getString(
"gender");
gender = new String(gender.getBytes(
"ISO-8859-1"),"gb2312");
session.setAttribute(
"gender",gender);
session.setAttribute(
"uID1",uID);
String uID1=(String)session.getAttribute(
"uID1");
apple. closeConn();
String laseTime=MyDate1;
sql=
"update pmusers set loginTimes=loginTimes+1,laseTime=\'"+laseTime+"\' where uID=\'"+uID1+"\'";
boolean To = apple.update(sql);
response.sendRedirect(
"show.jsp");
}
else
{
rs.close();
%>
<LINK href=
"news/css/gbook.css" rel=stylesheet>
<meta http-equiv='refresh' content='2;URL=logins.jsp'>
<body background=
"images/bgs.gif"]
<table align=center bgcolor=#000000 border=0 cellpadding=3 cellspacing=1
height=141 width=
"90%"]
<tbody>
<tr>
<td height=
"18" valign=top bgcolor=#f7f7f7>&nbsp;<tr valign="top"]


<td height=87 bgcolor=#ebebeb> [div align=
"center"]<br>
<br>
用户名或密码错误!请重新输入!<br>
<br>
系统在2秒钟自动返回[/div]<tbody>

<tr>
<td height=
"22" bgcolor=#ffffff>&nbsp;
</table>
</BODY></HTML>
<%}

apple. closeConn();

%>

lunzi   2004-12-04 21:09:08 评论:0   阅读:1059   引用:0

发表评论>>

署名发表(评论可管理,不必输入下面的姓名)

姓名:

主题:

内容: 最少15个,最长1000个字符

验证码: (如不清楚,请刷新)

Copyright@2004-2010 powered by YuLog