adminteacher2.jsp
上传用户:mkymky1985
上传日期:2014-06-23
资源大小:754k
文件大小:2k
源码类别:

其他数据库

开发平台:

Java

  1. <%@ page language = "java" contentType = "text/html;charset=gb2312"%>
  2. <%@ page import = "java.sql.*" %>
  3. <jsp:useBean id="subject" scope="page" class="wsxk.ConDB"/>
  4. <%! String trans(String chi)
  5. {
  6.                String result = null;
  7.                byte temp [];
  8.                try
  9.                 {
  10.                       temp=chi.getBytes("iso-8859-1");
  11.                       result = new String(temp, "gb2312");
  12.                 }
  13.                 catch(Exception e)
  14.                 {
  15.                         System.out.println (e.toString());
  16.                 }
  17.                 return result;
  18. }
  19. %>
  20. <%
  21. String teaid = new String (request.getParameter("teaid"));
  22. String teaname = new String (request.getParameter("teaname"));
  23. //String stuno = new String (request.getParameter("stuno"));
  24. //String stugrade = new String (request.getParameter("stugrade"));
  25. String teapsw = new String (request.getParameter("teapsw"));
  26. System.out.println (teaid);
  27. //System.out.println("EEEE333");
  28. String str = null;
  29. String str2 = "";
  30. %>
  31. <% if (teaid.trim().equals("")||teaname.trim().equals("")||teapsw.trim().equals(""))
  32. {response.sendRedirect("adminteachererr.htm");}
  33. else{String sql2 = "insert into teacher(teaid, teapsw, teaname) values('" + teaid + "','" +teapsw+ "','" + trans(teaname) + "')";
  34. subject.executeUpdate(sql2);}
  35. %>
  36. <html>
  37. <head>
  38. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  39. <meta HTTP-EQUIV=REFRESH CONTENT="10; URL=adminteacher.jsp">
  40. <link href="_notes/aaa.css" rel="stylesheet" type="text/css">
  41. <style type="text/css">
  42. <!--
  43. @import url("_notes/ccc");
  44. body,td,th {
  45. font-size: 12px;
  46. color: #FFFFFF;
  47. font-weight: bold;
  48. }
  49. .style1 {color: #000000}
  50. -->
  51. </style>
  52. </HEAD>
  53. <BODY BGCOLOR=#0D85A6 BACKGROUND="images/bg.gif" >
  54. <div align="center">
  55.   <p align="left">    <br>
  56.   教师注册成功,本页将于10秒内自动<a href="adminteacher.jsp" class="style1">返回前页</a></p>
  57.   <p><br>
  58.     <img src="images/qa.jpg" width="640" height="427"></p>
  59. </div>
  60. </BODY>
  61. </HTML>