小菜鸟在线求助,大虾们帮帮忙
是登陆问题
代码:
<%@ page contentType= "text/html; charset=gb2312 " %>
<%@ page import= "java.sql.* " %>
<html>
<head>
<script language= "javascript " type= "text/javascript ">
<!--
function onClick()
{
this.location.replace( "register.jsp ");
}
-->
</script>
<title> 用户登录 </title>
<style type= "text/css ">
<!--
.STYLE1 {
color: #333333;
font-weight: bold;
font-size: large;
}
-->
</style>
</head>
<body>
<%
try
{
String strId= " ";
String strName= " ";
String strPassword= " ";
String strMsg= " ";session.setAttribute( "loginId ", " ");
strId=request.getParameter( "id ");
strPassword=request.getParameter( "password ");
if(strId!=null && strPassword!=null && !strId.equals( " ")&&!strPassword.equals( " "))
{
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver ");
Connection con=DriverManager.getConnection( "jdbc:odbc:yunshu ");
Statement statement=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs=null;
String String_SQL= "select id from sjinfo where id= ' "+strId+ " ' and password= ' "+strPassword+ " ' ";
rs=statement.executeQuery(String_SQL);
if(!rs.next())
{
strMsg= "你输入的用户名或密码不正确,请重新输入! ";
out.println( "123 "+strMsg);
%>
<script language= "javascript " type= "text/javascript ">
<!--
alert( "重新输入 ");
--&