日期:2014-05-16 浏览次数:20377 次
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<% int flag=0; %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改个人信息</title>
<script language="javascript">
function back()
{
document.form.action="login_success.jsp";
return true;
}
function handle()
{
<% flag=5;%>
return true;
}
function fresh()
{
document.form.action="changeinfo.jsp";
<%flag=6;%>
return true;
}
</script>
</head>
<body>
<%
String name="";
Object obj=session.getAttribute("UserName");
if(obj!=null)
name=obj.toString();
%>
<div align="left">
<table border="1" width="25%" height="10" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<h3><br>
<b><font color="black" size="5">修改个人信息</font></b>
</h3>
</td>
</tr>
</table>
<% //链接数据库获取用户信息
Statement stmt=null;
ResultSet rs1=null;
try{
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql","root","123");
String sql="select * from UserInfo where UserName= '"+name+"'";
//out.print(name);
stmt=conn.createStatement();
rs1=stmt.executeQuery(sql);
while(rs1.next())
{
%>
<br><%-- --%>
<font size="4" color="blue" >用户名: <font color="red"><input type="text" name="username" ></font></font>
<font size="2" color="red">*用户名不能修改</font> <br>
<font size="4" color="blue" >密码: <input type="password" name="txtPassword" size="20" maxlength="20" value="<%=rs1.getString("PassWord") %>">
<font size="2" color="red">*(3-20位)</font> <br>
<font size="4" color="blue" >性别: <select size="1" id="sltGender">
<option value="0">女</option>
<option value="1">男</option></select><br>
<font size="4" color="blue" >电话: <font color="red"> <input type="txt" name="txtTel" size="20" maxlength="20" value="<%=rs1.getString("Phone") %>"></font></font><br>
<font size="4" color="blue" >邮件: <font color="red">
<input type="text" name="txtEmail" size="20" maxlength="30" value="<%=rs1.getString("E_mail") %>"></font></font><br>
<%
}%>
<form name="form" method="post" >
<input typ