⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 moduser_jsp.java

📁 做的非常好的论坛
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package org.apache.jsp.bbs;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.util.*;
import java.util.Date;
import java.text.*;

public final class moduser_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {


public String htmln(String ftbbs)
{  String htmlftbbs;
   ftbbs = htmlz(ftbbs,"&lt;","<");
   ftbbs = htmlz(ftbbs,"&gt;",">");
   ftbbs = htmlz(ftbbs,"<br>","\n");
   ftbbs = htmlz(ftbbs,"&nbsp;"," ");
   return ftbbs;
}
public String htmlz(String str,String newstr,String oldstr)
{

 int find = -1;
 int oldrep = oldstr.length();
 
 do{
 find = str.indexOf(oldstr);

 if(find != -1)
    str = str.substring(0,find) + newstr + str.substring(find+oldrep);

   }while(find != -1);

  return str;
}

ResultSet rs;
  private static java.util.Vector _jspx_dependants;

  static {
    _jspx_dependants = new java.util.Vector(3);
    _jspx_dependants.add("/bbs/../admin/checkmaster.jsp");
    _jspx_dependants.add("/bbs/../inc/conn.jsp");
    _jspx_dependants.add("/bbs/../inc/ftbbstohtml.jsp");
  }

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=gb2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write(" \r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write('\r');
      out.write('\n');

String bbsadmin=null;
bbsadmin = (String)session.getAttribute("bbsadmin");
if(bbsadmin==""||bbsadmin==null)
{
  out.print("<script>window.open('../admin/index.jsp');</script>");
  //out.print("<script>");
  //out.print("alert('你的权限太低无法进入!');");
  //out.print("window.location.href='../admin/index.jsp';");
  //out.print("</script>");
}

      out.write('\r');
      out.write('\n');
      out.write('\r');
      out.write('\n');
      out.write('\r');
      out.write('\n');


  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  String url="jdbc:odbc:db2000";

Connection conn= DriverManager.getConnection(url); 
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); 


      out.write('\r');
      out.write('\n');
      out.write('\r');
      out.write('\n');
      out.write('\r');
      out.write('\n');

String sql;
String id = request.getParameter("id");

sql="select * from clubuser where clubuser_id="+id;
rs=stmt.executeQuery(sql);
rs.next();

      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("<link href=\"../css/xmwuye.css\" rel=\"stylesheet\" type=\"text/css\">\r\n");
      out.write("<title>修改用户资料</title>\r\n");
      out.write("\r\n");
      out.write("</head>\r\n");
      out.write("<script language=\"javascript\">\r\n");
      out.write("<!--\r\n");
      out.write("\tfunction check(form)\r\n");
      out.write("\t{\r\n");
      out.write("    if (form.bbsuser.value==\"\")\r\n");
      out.write("    \t{\r\n");
      out.write("    \t\talert(\"请填写用户名!\");\r\n");
      out.write("    \t\tform.bbsuser.focus();\r\n");
      out.write("    \t\treturn false;\r\n");
      out.write("  \t    }\r\n");
      out.write("  if (form.bbsuser.value.length<3||form.bbsuser.value.length>8)\r\n");
      out.write("   {\r\n");
      out.write("     alert(\"昵称长度只能是3-8位。\");\r\n");
      out.write("     form.bbsuser.focus();\r\n");
      out.write("     form.cbbsuser.select();\r\n");
      out.write("     return false;\r\n");
      out.write("   } \r\n");
      out.write("    if (form.password.value==\"\")\r\n");
      out.write("    \t{\r\n");
      out.write("    \t\talert(\"请填写密码!\");\r\n");
      out.write("    \t\tform.password.focus();\r\n");
      out.write("    \t\treturn false;\r\n");
      out.write("  \t}\r\n");
      out.write("  if (form.password.value.length<3||form.password.value.length>8)\r\n");
      out.write("   {\r\n");
      out.write("     alert(\"密码长度只能是3-8位。\");\r\n");
      out.write("     form.password.focus();\r\n");
      out.write("     form.password.select();\r\n");
      out.write("     return false;\r\n");
      out.write("   } \r\n");
      out.write("    if (form.pwdsub.value==\"\")\r\n");
      out.write("    \t{\r\n");
      out.write("    \t\talert(\"请填写确认密码!\");\r\n");
      out.write("    \t\tform.pwdsub.focus();\r\n");
      out.write("    \t\treturn false;\r\n");
      out.write("  \t}\r\n");
      out.write("    if (form.pwdsub.value!=form.password.value)\r\n");
      out.write("    \t{\r\n");
      out.write("    \t\talert(\"密码和密码确认不一致!\");\r\n");
      out.write("    \t\tform.pwdsub.focus();\r\n");
      out.write("    \t\treturn false;\r\n");
      out.write("  \t}\r\n");
      out.write("    if (form.question.value==\"\")\r\n");
      out.write("    \t{\r\n");
      out.write("    \t\talert(\"请填写忘记密码时的问题!\");\r\n");
      out.write("    \t\tform.question.focus();\r\n");
      out.write("    \t\treturn false;\r\n");
      out.write("  \t}\r\n");
      out.write("    if (form.answer.value==\"\")\r\n");
      out.write("    \t{\r\n");
      out.write("    \t\talert(\"请填写问题的答案!\");\r\n");
      out.write("    \t\tform.answer.focus();\r\n");
      out.write("    \t\treturn false;\r\n");
      out.write("  \t}\r\n");
      out.write("return true;\r\n");
      out.write("\t}\r\n");
      out.write("//-->\r\n");
      out.write("</script>\r\n");
      out.write("<body topmargin=\"0\">\r\n");
      out.write("<form name=\"form1\" method=\"post\" action=\"moduseract.jsp\" onSubmit=\"return check(this)\">\r\n");
      out.write("  <table width=\"99%\" border=\"0\" align=\"center\" bgcolor=\"#A4B6D7\" cellspacing=\"1\" cellpadding=\"2\">\r\n");
      out.write("    <tr background=\"../images/bbs_bg1.gif\"> \r\n");
      out.write("      <td height=\"25\" colspan=\"2\"> \r\n");
      out.write("        <div align=\"center\">修改用户信息</div>\r\n");
      out.write("      </td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"23%\" height=\"23\" bgcolor=\"#F8F8F8\"> \r\n");
      out.write("        <div align=\"right\">用户名:</div>\r\n");
      out.write("      </td>\r\n");
      out.write("      <td width=\"77%\" bgcolor=\"#F8F8F8\"> &nbsp; \r\n");
      out.write("        <input name=\"clubuser_name\" type=\"text\" id=\"clubuser_name\" value=\"");
      out.print(rs.getObject("clubuser_name"));
      out.write("\" size=\"15\" maxlength=\"10\">\r\n");
      out.write("         <font color=\"#CC0000\">*<font color=\"#000000\">论坛中显示的网名</font></font></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"23%\" height=\"23\" bgcolor=\"#F8F8F8\"> \r\n");
      out.write("        <div align=\"right\">昵 称:</div>\r\n");
      out.write("      </td>\r\n");
      out.write("      <td width=\"77%\" bgcolor=\"#F8F8F8\"> &nbsp; \r\n");
      out.write("        <input name=\"bbsuser\" type=\"text\" id=\"bbsuser\" value=\"");
      out.print(rs.getObject("clubuser_nickname"));
      out.write("\" size=\"15\" maxlength=\"10\">\r\n");
      out.write("         <font color=\"#CC0000\">*<font color=\"#000000\">论坛中显示的网名</font></font></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"23%\" height=\"23\" bgcolor=\"#F8F8F8\"> \r\n");
      out.write("        <div align=\"right\">密 码:</div>\r\n");
      out.write("      </td>\r\n");
      out.write("      <td width=\"77%\" bgcolor=\"#F8F8F8\"> &nbsp; \r\n");
      out.write("        <input type=\"password\" name=\"password\" size=\"15\" maxlength=\"8\" value=\"\">\r\n");
      out.write("         <font color=\"#CC0000\">*(最多8位)</font></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"23%\" height=\"23\" bgcolor=\"#F8F8F8\"> \r\n");
      out.write("        <div align=\"right\">密码确认:</div>\r\n");
      out.write("      </td>\r\n");
      out.write("      <td width=\"77%\" bgcolor=\"#F8F8F8\"> &nbsp; \r\n");
      out.write("        <input type=\"password\" name=\"pwdsub\" size=\"25\" maxlength=\"8\" value=\"\">\r\n");
      out.write("         <font color=\"#CC0000\">*</font></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"23%\" height=\"23\" bgcolor=\"#F8F8F8\"> \r\n");
      out.write("        <div align=\"right\">忘记密码时的问题:</div>\r\n");
      out.write("      </td>\r\n");
      out.write("      <td width=\"77%\" bgcolor=\"#F8F8F8\"> &nbsp; \r\n");
      out.write("        <input type=\"text\" name=\"question\" size=\"25\" value=\"");
      out.print(rs.getObject("clubuser_question"));
      out.write("\">\r\n");
      out.write("         <font color=\"#CC0000\">*</font></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"23%\" height=\"23\" bgcolor=\"#F8F8F8\"> \r\n");
      out.write("        <div align=\"right\">问题的答案:</div>\r\n");
      out.write("      </td>\r\n");
      out.write("      <td width=\"77%\" bgcolor=\"#F8F8F8\"> &nbsp; \r\n");
      out.write("        <input type=\"text\" name=\"answer\" size=\"25\" value=\"");
      out.print(rs.getObject("clubuser_answer"));
      out.write("\">\r\n");
      out.write("         <font color=\"#CC0000\">*</font></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"23%\" height=\"23\" bgcolor=\"#F8F8F8\"> \r\n");
      out.write("        <div align=\"right\">您的性别:</div>\r\n");
      out.write("      </td>\r\n");
      out.write("      <td width=\"77%\" bgcolor=\"#F8F8F8\"> &nbsp; \r\n");
      out.write("        <input type=\"radio\" name=\"sex\" value=\"男\" ");
if (rs.getObject("clubuser_sex").toString().equals("男")){
      out.write("checked");
}
      out.write(">\r\n");
      out.write("        男   \r\n");
      out.write("        <input type=\"radio\" name=\"sex\" value=\"女\" ");
if (rs.getObject("clubuser_sex").toString().equals("女")){
      out.write("checked");
}
      out.write(">\r\n");
      out.write("        女</td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"23%\" height=\"23\" bgcolor=\"#F8F8F8\"> \r\n");
      out.write("        <div align=\"right\">你的E-mail信箱:</div>\r\n");
      out.write("      </td>\r\n");
      out.write("      <td width=\"77%\" bgcolor=\"#F8F8F8\"> &nbsp; \r\n");
      out.write("        <input type=\"text\" name=\"email\" size=\"25\" value=\"");
      out.print(rs.getObject("clubuser_email"));
      out.write("\">\r\n");
      out.write("         </td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"23%\" height=\"11\" bgcolor=\"#F8F8F8\"> \r\n");
      out.write("        <div align=\"right\">签名档:(150字以内)</div>\r\n");
      out.write("      </td>\r\n");
      out.write("      <td width=\"77%\" bgcolor=\"#F8F8F8\"> &nbsp; \r\n");
      out.write("        <textarea name=\"signname\" cols=\"65\" rows=\"6\">");
      out.print(rs.getObject("signname"));
      out.write("</textarea>\r\n");
      out.write("         </td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -