accountadd.jsp
资源名称:examasp.rar [点击查看]
上传用户:hjt198082
上传日期:2015-04-16
资源大小:95k
文件大小:2k
源码类别:
MySQL数据库
开发平台:
Java
- <%@page contentType="text/html;charset=GBK"%>
- <%@page import="java.sql.*" errorPage="/public/error.jsp"%>
- <%@ include file="/public/checkvalidadmin.jsp"%>
- <%@ include file="/public/checkvalidadmin8.jsp"%>
- <jsp:useBean id="conn" scope="page" class="test.ConnOracle"/>
- <%!
- String username = "";
- String truename = "";
- String password = "";
- String priv = "";
- String oper = "";
- String sql = "";
- int result = 0;
- %>
- <html>
- <head>
- <title>权限管理</title>
- <link rel="stylesheet" href="../public/style.css">
- </head>
- <Body class="ss">
- <center>
- <%
- request.setCharacterEncoding("GBK");
- username = request.getParameter("username");
- truename = request.getParameter("truename");
- password = request.getParameter("password");
- priv = request.getParameter("priv");
- // 避免用户直接在浏览器地址栏输入地址所产生的Exception
- if(username==null || username.equals("")) {
- out.println("<center>");
- out.println("请进行合法操作!");
- out.println("</center>");
- return;
- }
- try{
- sql = "insert into test_admin values('" + username + "'" ;
- sql+= ",'" + truename + "'";
- sql+= ",'" + password + "'";
- sql+= "," + priv + ")";
- result = conn.executeUpdate( sql );
- }catch(Exception ee) {
- out.println("<center>");
- out.println("管理员账号信息更新失败!<br><br>");
- out.println("请将下列信息告知管理员<br><br>");
- out.println(ee.toString() + "<br><br>");
- out.println("单击这里<a href=javascript:history.back()>返回</a><br>");
- out.println("</center>");
- }
- %>
- <jsp:forward page="accountmanager.jsp"/>
- </center>
- </Body>
- </html>