?? zengjiamingdan_confirm.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page language="java" import="java.sql.*" %>
<html>
<head>
<title>增加教師名單</title>
</head>
<body>
<jsp:useBean id="ss" scope="page" class="xyf.bean"/>
<%
Object D=session.getAttribute("Aid");
if (D==null){
out.print("對不起,你還沒登陸,請先登陸<a href=denglu.jsp>首頁</a>");
}
else
{
String id=request.getParameter("id");
String code_1=request.getParameter("code1");
String code_2=request.getParameter("code2");
String sql="select * from teacher";
int i=-1;
ResultSet rs=ss.executeQuery(sql);
while(rs.next()){
String name=rs.getString("id");
if(id.equals(name))
i=1;
}
if(i==1)
out.println("該用戶名已經存在,請重新輸入 <a href=zengjiajiaoshimingdan.jsp>返回</a>");
else if (code_1.equals(code_2)) {
String sql1="insert into teacher(id,password) values('"+id+"','"+code_1+"')";
ss.executeUpdate(sql1);
out.println("教師名單增加成功!");
out.println("用戶名="+id);
out.println("密碼="+code_1);
out.println("<a href='guanliyuanjiemian.jsp'>返回</a>");
}
else {
out.println("兩次密碼輸入不同,請重新輸入<a href=zengjiajiaoshimingdan.jsp>返回</a>");
}
}
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -