📄 modify_info.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<title>淳.清凉花坊</title>
<meta name="keywords" content="淳.清凉花坊">
<meta name="description" content="淳.清凉花坊">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="/css/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style4 {color: #FF0000}
.style6 {font-size: 12px}
.style11 {color: #006633}
.style13 {font-size: 12px;
color: #FFFFFF;
}
.style15 {color: #660000;
font-size: 14px;
font-weight: bold;
}
.style17 {color: #006633; font-size: 12px; }
-->
</style>
<script language="javascript">
function chkform(form){
if(form.oldPsw.value=="")
{
alert("请输入您的登陆密码!");
form.oldPsw.focus();
return false;
}
if ((form.newPsw.length<3)||(form.newPsw.value.length>8)){
alert("密码必须是3~8位数字或字符!") ;
form.newPsw.focus();
return false;
}
if (form.newPsw.value != form.newPsw2.value){
alert("您两次输入的密码不一致!");
form.newPsw2.focus();
return false;
}
if (form.username.value == ""){
alert("请输入您的真实姓名!");
form.username.focus();
return false;
}
if (form.phone.value == 0){
alert("请输入你的电话!");
form.phone.focus();
return false;
}
return true;
}
</script>
</head>
<%! //处理字符串的常用方法
public String getString(String s) {
if(s == null) s = "";
try{
byte a[] = s.getBytes("ISO-8859-1");
s = new String(a);
}
catch(Exception e) {}
return s;
}
%>
<% //获取session值,以及防止非法访问本页面
String userid= (String)session.getAttribute("userid");
String password= (String)session.getAttribute("password");
userid=getString(userid);
password=getString(password);
%>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="1667" border="0" cellspacing="0" cellpadding="0">
<tr>
<table id="Table_06" width="100%" height="588" border="0" cellpadding="0" cellspacing="0">
</table> <td width="49"></td>
<td width="444" align="center" valign="top"> </td>
<td width="1174" align="center" valign="top">
<table id="Table_06" width="74%" height="537" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="/images/6xiang_93.gif" width="22"> </td>
<td background="/images/6xiang_93.gif" width="147"><p align="left" class="style15"> </p>
<p align="left" class="style15"> </p>
<p align="left" class="style15"><img src="images/6xiang_06.gif" width="29" height="27">会员中心</p>
<p align="left"><img src="images/arrow_car.gif" width="15" height="15"><span class="style13"><a href="shoppingcart.jsp" class="style11">我的购买记录</a></span></p>
<p align="left"><img src="images/arrow_car.gif" width="15" height="15"><a href="cart.jsp" class="style17">我的购物车</a></p>
<p align="left"><img src="images/arrow_car.gif" width="15" height="15"><a href="userinfo.jsp" class="style17">我的注册信息</a></p>
<p align="left"><img src="images/arrow_car.gif" width="15" height="15"><span class="style11"><a href="modify_info.jsp" class="style17">修改我的资料</a></span></p>
<p align="left"><img src="images/arrow_car.gif" width="15" height="15"><a href="user_modPsw.jsp" class="style17">修改登陆密码</a></p>
<p align="left"><img src="images/arrow_car.gif" width="15" height="15"><a href="main.jsp" class="style17">退出会员中心</a> </p></td>
<td width="700" align="center" valign="top">
<table width="99%" height="165" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="163"><img src="images/4_img2.jpg" width="108" height="114" align="absmiddle"> <span class="style6">您的位置</span>:<span class="style6"><a href="/">HOME</a> >> <a href="userinfo.jsp">会员中心</a> >> 修改会员资料</span></td>
</tr>
</table>
<%
Connection con=null;
Statement sql=null;
ResultSet rs=null;
try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); }
catch(ClassNotFoundException event) { }
try {
con=DriverManager.getConnection("jdbc:odbc:sun","sa","");
sql=con.createStatement();
rs =sql.executeQuery("select * from uuser where userid="+"'"+userid+"'");
while(rs.next())
{
String oldPsw=rs.getString("password");
String username=rs.getString("username");
String sex=rs.getString("sex");
String phone=rs.getString("phone");
String email=rs.getString("email");
%>
<form action="modify_ok.jsp" method="post" name="regForm" onSubmit="return chkform(this)">
<table width="98%" border="0" cellpadding="5" cellspacing="1" bgcolor="#ECE9D8">
<tr align="center">
<td height="30" colspan="3" class="showbg_red"><b>
<font color="#800000"><span class="sstitle">修改会员资料</span>(</font><font color="#FF0000">*</font><font color="#800000">为必填写)</font></b></td>
</tr>
<tr bgcolor="#F9F8F2" class="sendarea">
<td width="39%" height="25" align="right">登陆昵称:</td>
<td height="25" colspan="2"><%=userid%> </td>
</tr>
<tr bgcolor="#F9F8F2">
<td height="25" align="right" class="sendarea">登陆密码:</td>
<td height="25" colspan="2"><input name="oldPsw" type="password" class="input" id="oldPsw" ><font color="#FF0000">*</font></td>
</tr>
<tr bgcolor="#F9F8F2">
<td height="25" align="right" class="sendarea">新 密 码:</td>
<td height="25" colspan="2"><input name="newPsw" type="password" class="input" id="newPsw" ><font color="#FF0000">*</font></td>
</tr>
<tr bgcolor="#F9F8F2">
<td height="25" align="right" class="sendarea">密码确认:</td>
<td height="25" colspan="2"><input name="newPsw2" type="password" class="input" id="newPsw2" ><font color="#FF0000">*</font></td>
</tr>
<tr bgcolor="#F9F8F2" class="sendarea">
<td height="25" align="right">姓 名:</td>
<td width="27%" height="25"><input name="username" type="text" class="input" value="<%=username%>"><font color="#FF0000">*</font></td>
<td width="30%"><input name="sex" type="radio" value="先生" checked>
先生
<input type="radio" name="sex" value="女士">
女士</td>
</tr>
<tr bgcolor="#F9F8F2">
<td height="25" align="right" class="sendarea">联系电话:</td>
<td height="25" colspan="2"><input name="phone" type="text" class="input" id="phone" value="<%=phone%>" ><font color="#FF0000">*</font></td>
</tr>
<tr bgcolor="#F9F8F2">
<td height="25" align="right" class="sendarea">注册邮箱:</td>
<td height="25" colspan="2"><input name="email" type="text" class="input" id="email" value="<%=email%>" size="40"></td>
</tr>
<tr bgcolor="#F9F8F2">
<td height="30" colspan="3" style="line-height:19px; ">
<font color="#008000">
<li><font size="2">请确认已正确填写您的个人信息和联系方式,以便于您订购的商品准时、准确地配送 !</font></li>
<li><font size="2">本网站将会对您的个人信息保密!</font></li>
</font></td>
</tr>
<tr align="center" bgcolor="#F9F8F2">
<td height="40" colspan="3">
<input name="Submit" type="Submit" class="button" value="修 改"></td>
</tr>
</table>
</form>
<%
}
con.close();
}
catch(SQLException e) { }
%>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -