没有合适的资源?快使用搜索试试~ 我知道了~
用SQL Server验证用户名和密码,从页面输入的用户名和密码与数据库的用户名和密码进行匹配,正确则登入,错误则提醒。 <form action=index.jsp method=post > <!–大的div框架开始–> <div id=div> <!–左边div框架开始–> <div id=div1> <p xss=removed>< ></></p> <div style=width:350px;height:20px;margin-left:30px;margi
资源推荐
资源详情
资源评论
用用SQL Server验证用户名和密码验证用户名和密码
用SQL Server验证用户名和密码,从页面输入的用户名和密码与数据库的用户名和密码进行匹配,正确则登入,错误则
提醒。
<form action="index.jsp" method="post" >
<!–大的div框架开始–>
<div id="div">
<!–左边div框架开始–>
<div id="div1">
<p style="margin-left:30px;"><img src="image/login/vjia.gif"></img></p>
<div style="width:350px;height:20px;margin-left:30px;margin-top:-10px">
<p><hr/></p>
</div>
<p style="margin-top:0px;margin-left:30px"><img src="image/red_btn.gif"></img></p>
<p style="margin-top:-35px;margin-left:40px;color:#fff;font-size:12px;align:center">Vjia用户</p>
<p style="margin-top:-28px;margin-left:110px"><img src="image/btn_long.gif"></img></p>
<p style="margin-top:-35px;margin-left:120px;font-size:12px">Vancl用户</p>
<div style="width:350px;height:20px;margin-left:30px;margin-top:-8px">
<p><hr/></p>
</div>
<p style="margin-left:60px">用户名:<input type="text" name="userName"></p>
<p style="margin-left:75px">密码:<input type="password" name="password"></p>
<p style="margin-left:150px;margin-top:10px"><input type="submit" value=""
style="width:65px;height:26px;background:url(image/tu2.gif)"></p>
<p style="margin-left:30px;margin-top:30px;margin-right:80px">使用合作伙伴账号登入Vjia:<img
src="image/account_qq.gif"></img></p>
<p style="margin-left:30px;margin-top:0px;color:red;font-weight:bold">温馨提示:</p>
<p style="text-indent:3em;font-size:14px">如果还未注册VJIA用户,您可以使用VANCL用户名进行登录,登录后系统会自动
为您注册一个与VANCL账户相关联的VJIA账户。账户关联后您可共享VANCL的会员积分和消费金额。</p>
<p style="margin-top:30px;margin-left:100px">有任何疑问请点击<font style="font-weight:bold">帮助中心</font>或<font
style="font-weight:bold">联系客服</font></p>
</div>
</form>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="jdbc.sqlServer"%>
<%
String userName = request.getParameter("userName");
userName = new String(userName.getBytes("ISO-8859-1"),"utf-8");
String password = request.getParameter("password");
//引用连接数据库方法
sqlServer sq=new sqlServer();
//得到数据库连接
Connection con = sq.getConnection();
//编写sql语句
String sql="select * from Admin where userName=? and password=? ";
//得到数据库操作对象
PreparedStatement st=null;
st =con.prepareStatement(sql);
st.setString(1,userName);
st.setString(2,password);
//得到结果集
ResultSet rs=null;
rs=st.executeQuery();
if(rs.next()){
session.setAttribute("url",userName);
%>
<script type="text/javascript">
alert("登入成功");
location="jieHe.jsp";
</script>
<%
}else{
%>
<script type="text/javascript">
资源评论
weixin_38705640
- 粉丝: 8
- 资源: 953
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功