?? myinfo.jsp
字號(hào):
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="incdb.jsp"%>
<jsp:useBean id="user" class="test.bbsuser" scope="page"/>
<%
String strSQL;// '執(zhí)行的SQL語(yǔ)句
java.sql.ResultSet sqlRst; //'ADODB RECORDSE 對(duì)象
java.sql.ResultSet sqlRst2; //'ADODB RECORDSE 對(duì)象
int i,pages;
String errmsg,username,tempSTR;
errmsg=request.getParameter("errmsg");
if (errmsg==null){
errmsg="";
}
tempSTR=request.getParameter("pages");
if (tempSTR==null){
pages=3;
}
else
{
pages=java.lang.Integer.parseInt(tempSTR);
}
//'
//'
//'pages=1 修改個(gè)人信息
//'pages=2 更改個(gè)人密碼
//'pages=3 查詢個(gè)人信息
//'
//'
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<link rel="stylesheet" type="text/css" href="bbs03.css">
<script Language="JavaScript">
<!--
function isspacestring(mystring)
//是否為空格字符串;true為空,F(xiàn)ALSE為非空
{ var istring=mystring;
var temp,i,strlen;
temp=true;
strlen=istring.length;
for (i=0;i<strlen;i++)
{
if ((istring.substring(i,i+1)!=" ")&(temp))
{ temp=false; }
}
return temp;
}
function firstisspace(mystring)
//檢查首字母是否是空格,TRUE首字母為空格;FALSE首字母不為空格
{ var istring=mystring;
var temp,i;
temp=true;
if (istring.substring(0,1)!=" ")
{ temp=false; }
return temp;
}
function check_input(theForm)
{
if ((theForm.username.value =="")|(isspacestring(theForm.username.value)))
{
alert("請(qǐng)輸入用戶名!");
theForm.username.focus();
return (false);
}
if ((theForm.userpassword.value =="")|(isspacestring(theForm.userpassword.value)))
{
alert("請(qǐng)輸入舊密碼!");
theForm.userpassword.focus();
return (false);
}
if ((theForm.newpwd.value =="")|(isspacestring(theForm.newpwd.value)))
{
alert("請(qǐng)輸入新的密碼!");
theForm.newpwd.focus();
return (false);
}
if ((theForm.newpwd.value !=theForm.newpwd2.value))
{
alert("兩次密碼不相同!請(qǐng)重新輸入密碼.");
theForm.newpwd.focus();
return (false);
}
if (theForm.newpwd.value.length > 10)
{
alert("密碼太長(zhǎng)了,請(qǐng)重新輸入.");
theForm.newpwd.focus();
return (false);
}
return (true);
}
-->
</script>
</head>
<body>
<table border="1" width="100%" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellspacing="0" cellpadding="0">
<tr>
<td width="34%" bgcolor="#000080" align="center"><a href="myinfo.jsp?pages=1" target="_self"><font color="#FFFFFF">修改個(gè)人信息</font></a></td>
<td width="33%" bgcolor="#000080" align="center"><a href="myinfo.jsp?pages=2" target="_self"><font color="#FFFFFF">更改個(gè)人密碼</font></a></td>
<td width="33%" bgcolor="#000080" align="center"><a href="myinfo.jsp?pages=3" target="_self"><font color="#FFFFFF">查詢個(gè)人信息</font></a></td>
</tr>
<tr>
<td width="100%" colspan="3">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="34%" valign="top">
<!------------------------------------------------------------------------->
<%
if (pages==1) {
//'pages=1 修改個(gè)人信息
%>
<form method="POST" action="userinfo.jsp">
<p><%=errmsg%><br>
用戶:<input type="text" name="username" size="15"><br>
密碼:<input type="password" name="userpassword" size="10"></p>
<p align="center"><input class="buttonface" type="submit" value="確定" name="B1">
<input class="buttonface" type="reset" value="重寫" name="B2"></p>
<input type="hidden" name="method" value="3">
</form>
<%} //'End if%>
<!-------------------------------------------------------------------------> </td>
<td width="33%" valign="top">
<!------------------------------------------------------------------------->
<%if (pages==2) {
//'pages=2 更改個(gè)人密碼
%>
<form method="POST" action="userinfo.jsp" onSubmit="return check_input(this)" name="form1"><%=errmsg%><br>
<p>用 戶:<input type="text" name="username" size="15"><br>
舊的密碼:<input type="password" name="userpassword" size="10"><br>
新的密碼:<input type="password" name="newpwd" size="10"><br>
確認(rèn)密碼:<input type="password" name="newpwd2" size="10"></p>
<p align="center"><input class="buttonface" type="submit" value="確定" name="B1">
<input class="buttonface" type="reset" value="重寫" name="B2"></p>
<input type="hidden" name="method" value="2">
</form>
<%} //'End if%>
<!-------------------------------------------------------------------------> </td>
<td width="33%" valign="top">
<!------------------------------------------------------------------------->
<%if (pages==3) {
//'pages=3 查詢個(gè)人信息
%>
<form method="POST" action="userinfo.jsp">
<p align="center"><%=errmsg%><br>
用戶名:<select size="1" name="username">
<%
sqlRst=user.listUser(1);
i=1;
String sel;
while (sqlRst.next()) {
if (i==1) {
sel="selected";
}
else {
sel="";
}
username=sqlRst.getString("username");
%>
<option value="<%=username%>" <%=sel%>><%=username%></option>
<%
i++;
}
sqlRst.close();
%>
</select><br>
<br>
<input class="buttonface" type="submit" value="確定" name="B1"> <input class="buttonface" type="reset" value="重寫" name="B2"></p>
<input type="hidden" name="method" value="1">
</form>
<%} //'End if%>
<!------------------------------------------------------------------------->
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -