基于用户的新闻系统!之四
申请帐号后直接登陆的文件!注册文件之四
上个文件名:chkregister.jsp
reglogin.jsp
<br><%@page contentType="text/html;charset=gb2312" %>
<%@ include file=
"inc.jsp" %>
<%
String uID = (String)session.getAttribute(
"uIDS");
String password=(String)session.getAttribute(
"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();
java.util.Date date =new java.util.Date();
int yyyy=1900+date.getYear();
int mm=date.getMonth()+1;
int dd=date.getDate();
int hh=date.getHours();
int mi=date.getMinutes();
int ss=date.getSeconds();
String laseTime= yyyy+
"-"+mm+"-"+dd+" "+hh+":"+mi+":"+ss;
String Date= +yyyy+
""+mm+""+dd+""+hh+""+mi;
sql=
"update pmusers set loginTimes=loginTimes+1,laseTime=\'"+laseTime+"\' where uID=\'"+uID1+"\'";
boolean To = apple.update(sql);
response.sendRedirect(
"show.jsp");
}
else
{
rs.close();
%>
<center>
<meta http-equiv=
"refresh" content="0;URL=logins.jsp"]
</center>
<%}

apple. closeConn();

%>

lunzi   2004-12-04 21:05:19 评论:0   阅读:999   引用:0

发表评论>>

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

姓名:

主题:

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

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

Copyright@2004-2010 powered by YuLog