国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > SQL Server > 正文

用SQL Server驗證用戶名和密碼

2024-08-31 00:54:27
字體:
來源:轉載
供稿:網友
用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">                alert("請先注冊,后登入");                location="doLog.jsp";            </script>          <% }       //釋放資源     sq.ShiFang(rs,st,con);            %>         


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 新绛县| 南皮县| 仪征市| 宣恩县| 饶河县| 许昌市| 鄂托克旗| 洪泽县| 巫溪县| 泸西县| 石阡县| 前郭尔| 宜川县| 平果县| 峨眉山市| 马鞍山市| 沙湾县| 泸定县| 攀枝花市| 嫩江县| 清丰县| 屏南县| 南通市| 云安县| 南宁市| 波密县| 榕江县| 固原市| 嵩明县| 佛冈县| 镇赉县| 延津县| 宜都市| 新河县| 大埔县| 封开县| 台中县| 宜宾市| 来凤县| 会理县| 延吉市|