reg_bean_ok.jsp
来自「jsp的技术教程」· JSP 代码 · 共 175 行
JSP
175 行
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type="dates.JspCalendar" />
<jsp:useBean id="workM" scope="page" class="test.faq" />
<%!String logname,realname,passwd1,passwd2,email,gender,phone;
String problem,answer,province,education,selfintro,hobby;
String[] hobbies;
%>
<% //out.print(request.getParameterValues("logname"));
logname=request.getParameter("logname");
realname=request.getParameter("realname");
passwd1=request.getParameter("passwd1");
passwd2=request.getParameter("passwd2");
email=request.getParameter("email");
gender=request.getParameter("Gender");
if(gender.equals("0")){
gender="female";
}
phone=request.getParameter("phone");
problem=request.getParameter("problem");
answer=request.getParameter("answer");
province=request.getParameter("Province");
education=request.getParameter("education");
if(education.equals("0")){
education="education";
}
hobbies=request.getParameterValues("hobbies");
hobby="0@";
if(hobbies!=null){
for (int i=0;i<hobbies.length;i++){
hobby=hobby+hobbies[i];
}
}
selfintro=request.getParameter("selfintro");
%>
<%
String sqldel="insert into member(logname,realname,password,email,gender,phone,problem,answer,province,education,hobbies,selfintro) Values('"+logname+"','"+realname+"','"+passwd1+"','"+email+"','"+gender+"','"+phone+"','"+problem+"','"+answer+"','"+province+"','"+education+"','"+hobby+"','"+selfintro+"')";
// out.println(sqldel);
workM.executeQuery(sqldel);
%>
<%@ include file="header.inc"%>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=760 align="center">
<TBODY>
<tr><td align="left" height=25><%if(session.getAttribute("username")!=null){out.println(session.getAttribute("username"));}%> 当前位置:<a href="../index.jsp">首页</a> -> 成员服务 </td>
<td align="right"> <%@ include file="date.inc"%> </td>
</tr>
<TR bgColor=#3399ff>
<TD height=1 colspan="2"><IMG height=1 src="images/spacer.gif"
width=16></TD></TR>
<tr><td height=10 colspan="2"><IMG height=1 src="images/spacer.gif"
width=16></td></tr>
</TBODY></TABLE>
<table align="center" border="0" width="760" cellspacing="0" cellpadding="0" height="355">
<tr>
<td width="150" height="355" valign="top">
<%@ include file="table.inc"%>
</td>
<td width="10" height="100%"></td>
<td width="1" height="100%" bgcolor="#3399ff"></td>
<td width="10" height="100%"></td>
<td width="589" height="331" valign="top" background="images/bg1.gif">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="307">
<tr align=center>
<td width="100%" colspan="4" height="20" bgcolor="#3399ff"> <font color="#ffffff">注册成功注册成功注册成功注册成功注册成功注册成功</font> <a href="javascript:history.go(-1)">返回</a>
</td>
</tr>
<tr>
<td width="100%" align="center" colspan="4" height="36"> <font color="Red">本页通过request实现</font> <a href="formbean.html">通过JavaBean如何实现 </a></td>
</tr>
<tr>
<td align="right" ><b>登录名称:</b></td>
<td > </td>
<td colspan="2" >
<%out.println(logname);%>
</td>
</tr>
<tr>
<td align="right"><b>真实姓名:</b></td>
<td> </td>
<td colspan="2">
<%=realname%>
</td>
</tr>
<tr>
<td align="right"><b>您的密码:</b></td>
<td> </td>
<td colspan="2">
<%=passwd1%>
</td>
</tr>
<tr>
<td align="right"><b>密码确认:</b></td>
<td> </td>
<td colspan="2">
<%=passwd2%>
</td>
</tr>
<tr>
<td align="right"><b>电子邮件:</b></td>
<td> </td>
<td colspan="2">
<%=email%>
</td>
</tr>
<tr>
<td align="right"><b>性 别:</b></td>
<td> </td>
<td colspan="2">
<%=gender%></td>
</tr>
<tr>
<td align="right">联系电话:</td>
<td> </td>
<td colspan="2">
<%=phone%>
</td>
</tr>
<tr>
<td align="right">密码提示问题:</td>
<td> </td>
<td colspan="2">
<%=problem%>
</td>
</tr>
<tr>
<td align="right">提示答案:</td>
<td> </td>
<td colspan="2">
<%=answer%>
</td>
</tr>
<tr>
<td align="right">省市:</td>
<td> </td>
<td colspan="2">
<%=province%>
</td>
</tr>
<tr>
<td align="right">教育程度:</td>
<td> </td>
<td colspan="2">
<%=education%>
</td>
</tr>
<tr>
<td align="right">兴趣爱好:</td>
<td> </td>
<td>
<%
if(hobbies!=null){
for (int i=0;i<hobbies.length;i++){
out.print(hobbies[i]);
}
}else out.print("你没有爱好");
%>
</td>
</tr>
<tr>
<td align="right" valign="top">自我简介:</td>
<td> </td>
<td colspan="2">
<%=selfintro%>
</td>
</tr>
</table>
</CENTER>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?