forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckUserName.jsp
More file actions
38 lines (36 loc) · 1.37 KB
/
checkUserName.jsp
File metadata and controls
38 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="chStr" scope="page" class="com.tools.ChStr"/>
<jsp:useBean id="conn" scope="page" class="com.tools.ConnDB"/>
<%
String username=chStr.chStr(request.getParameter("username"));
ResultSet rs=conn.executeQuery("select * from tb_member where username='"+username+"'");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>检测用户名</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="CSS/style.css" rel="stylesheet">
</head>
<body>
<table width="100%" height="125" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="7" align="center"> </td>
</tr>
<%
if(rs.next()){
%>
<tr>
<td height="45" align="center"><%out.println("很报歉!<br><br>["+username+"]用户名已经被注册!");%></td>
</tr>
<%}else{%>
<tr>
<td height="56" align="center"><%out.println("祝贺您!<br><br>["+username+"]用户名没有被注册!");%></td>
</tr>
<%}%>
<tr>
<td height="30" align="center"><input name="Button" type="button" class="btn_bg_short" onClick="window.close();" value="关闭"></td>
</tr>
</table>
</body>
</html>