forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmcheck.jsp
More file actions
61 lines (58 loc) · 1.67 KB
/
tmcheck.jsp
File metadata and controls
61 lines (58 loc) · 1.67 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" %>
<%@ page import="com.bwm.db.Condb"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%
Condb con=new Condb();
String result=request.getParameter("result");
String mname=request.getParameter("mname");
String munit=request.getParameter("munit");
String moffice=request.getParameter("moffice");
int inttem=0;
if(result!=null||result.equals("")||mname!=null||munit!=null||moffice!=null){
String str="select Member from tb_Member where MemID='"+result+"'";
ResultSet rs=con.executeQuery(str);
while(rs.next()){
inttem++;
}
if(inttem==1){
%>
<a href="memberadd.htm"><center>
<p> </p>
<p> </p>
<p><font size="+3" color="#0033CC" face="华文行楷">
<%out.println("此成员ID已经被占用返回重新命名!");%>
</font></p>
</center></a>
<%
}
else if(inttem==0){
String sql="insert into tb_Member(MemID,Member,Munit,Moffice)values('"+result+"','"+mname+"','"+munit+"','"+moffice+"')";
con.executeUpdate(sql);
%>
<center>
<p> </p>
<p> </p>
<p><font size="+3" face="华文行楷" color="#0033FF">
<%out.println("添加成功");%>
</font></p>
</center>
<center>
<p> </p>
<p> </p>
<p><a href="tmember.htm"><font size="+1" color="#0033FF" face="黑体">添加新成员</font></a></p>
</center>
<center>
<p><a href="taskadd.htm"><font size="+1" color="#0033FF" face="华文行楷">进入申报系统</font></a></p>
</center>
<%
}
}
con.close();
%>
</body>
</html>