zoukankan      html  css  js  c++  java
  • 登录界面

    网页登陆简单登陆界面

    代码如下:

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <form action="yanzheng.jsp" method="post">     用户名:<input type="text" name="username"><br>     密码:<input type="password" name="password"><br>     <input type="submit" value="登录"> </form> </body> </html> <%@ page language="java" import="java.sql.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <% Connection conn = null; Statement st = null; ResultSet rs = null; Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost:3306/login?user=root&password=123"; conn = DriverManager.getConnection(url); String u = request.getParameter("username"); String p = request.getParameter("password"); String sql = "select * from userinfo where username='" + u + "' and password=123'"+ p +"'"; st = conn.createStatement(); rs = st.executeQuery(sql);     if(rs.next()){       %> <h1>登陆成功</h1> <%     }else{       %> <h1>登陆失败</h1><%       }     if(rs != null){     rs.close();     }     if(st != null){     st.close();     }     if(conn != null){     conn.close();     } %> </body> </html>
  • 相关阅读:
    js 匿名函数的链式调用
    mysql 数据库操作的一般操作命令
    js 截取一定数量的字节
    js 截取10个字节
    BootStrap入门教程 (四)
    安装Dedecms遇到的一系列问题
    BootStrap入门教程 (三)
    dedecms标签调用大全
    artDialog皮肤引入方式
    织梦cms安装完成后登录后台出现空白。主要原因是php版本的问题
  • 原文地址:https://www.cnblogs.com/wwd1505-1/p/6491990.html
Copyright © 2011-2022 走看看