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

📄 mymodify.asp

📁 应用于高等院校党团思想教育
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/char.asp"-->
<html>
<head>
<title><%=ForumName%>--修改资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="forum.css" rel=stylesheet>
</head>
<body bgcolor="#ffffff" alink="#333333" vlink="#333333" link="#333333" topmargin=10 leftmargin=10>
<%
dim errmsg
dim founderr
founderr=false

if Session.Contents("UserName")="" then
  	errmsg=errmsg+"<br>"+"<li>您没有<a href=login.asp target=_blank>登录</a>。"
	founderr=true
else
	set rs=server.createobject("adodb.recordset")
	cname=Session.Contents("UserName")
	if request("action")="update" then
		if request("sex")="" then
			errmsg=errmsg+"<br>"+"<li>请选择您的性别。"
			founderr=true
		elseif request("sex")=0 or request("sex")=1 then
			sex=request("sex")
		else
			errmsg=errmsg+"<br>"+"<li>您输入的字符非法。"
			founderr=true
		end if
		if request("psw")="" then
		  	errmsg=errmsg+"<br>"+"<li>请输入您的密码。"
			founderr=true
		else
			password=request("psw")
		end if
		if request("myface")<>"" then
			if request("width")="" or request("height")="" then
				errmsg=errmsg+"<br>"+"<li>请输入图片的宽度和高度。"
				founderr=true
			elseif not isInteger(request("width")) or not isInteger(request("height")) then
				errmsg=errmsg+"<br>"+"<li>您输入的字符不合法。"
				founderr=true
			elseif request("width")<20 or request("width")>120 then
				errmsg=errmsg+"<br>"+"<li>您输入的图片宽度不符合标准。"
				founderr=true
			elseif request("height")<20 or request("height")>160 then
				errmsg=errmsg+"<br>"+"<li>您输入的图片高度不符合标准。"
				founderr=true
			else
				face=request("myface")
				width=request("width")
				height=request("height")
			end if
		else
			if request("face")="" then
				errmsg=errmsg+"<br>"+"<li>请选择您的个性头像。"
				founderr=true
			elseif Instr(request("face"),picurl)>0 then
				face=request("face")
				width=32
				height=32
			else
				errmsg=errmsg+"<br>"+"<li>您选择了错误的头像。"
				founderr=true
			end if
		end if
		if IsValidEmail(request("Email"))=false then
   			errmsg=errmsg+"<br>"+"<li>您的Email有错误。"
   			founderr=true
		else
			Email=request("Email")
		end if
		if request("oicq")<>"" then
			if chkoicq(request("oicq"))=false then
			errmsg=errmsg+"<br>"+"<li>Oicq号码只能是4-10位数字,您可以选择不输入。"
			founderr=true
			end if
		end if
	else
		call userinfo()
	end if
end if

if founderr=true then
	call error()
else
	if request("action")="update" then
		if founderr=true then
		call error()
		else
		call update()
		call success()
		end if
	end if
end if

sub userinfo()
	sql="Select * from [User] where username='"&trim(cname)&"'"
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
		founderr=true
	else
%>
<script language="JavaScript">
var currentpos,timer;
function initialize()
{timer=setInterval("scrollwindow()",1);}
function sc(){clearInterval(timer);	}
function scrollwindow()
{currentpos=document.body.scrollTop; window.scroll(0,++currentpos);
if (currentpos != document.body.scrollTop) sc();}
document.onmousedown=sc
document.ondblclick=initialize
function New(para_URL)
{var URL =new String(para_URL)
window.open(URL,'','resizable,scrollbars')}
</script>
<form action="mymodify.asp?action=update&username=<%=htmlencode(cname)%>" method=POST>
    <table cellpadding=0 cellspacing=0 border=0 width=95% bgcolor=<%=aTablebackcolor%> align=center>
        <tr>
            <td>
                <table cellpadding=3 cellspacing=1 border=0 width=100%>
    <tr align="center"> 
     <td width="14%" bgcolor=#FFE6F2><a href="javascript:window.close()">关闭窗口</a></td>
     <td width="73%" bgcolor=<%=aTabletitlecolor%>><b>修改资料</b></td>
    </tr>
      <tr bgcolor=<%=Tablebodycolor%>> 
        <td width="30%">注 册 名*</td>   
        <td width="70%"> <%=htmlencode(RS("username"))%></td>   
      </tr>   
      <tr bgcolor=<%=Tablebodycolor%>>    
        <td width="30%">性 别</td>   
        <td width="70%"><input type="radio" value="1"<%if rs("sex")=1 then%> checked <%end if%>name="Sex">酷哥
      <input type="radio" name="Sex"<%if rs("sex")=0 then%> checked <%end if%> value="0">靓妹</td>
</td>   
      </tr>   
      <tr bgcolor=<%=Tablebodycolor%>>    
        <td width="30%">密&nbsp;&nbsp;&nbsp;&nbsp;码*</td>   
        <td width="70%">    
          <input type="text" name="psw" value="<%=htmlencode(RS("userpassword"))%>" size=15 maxlength=13>   
        </td>   
      </tr>   
      <tr bgcolor=<%=Tablebodycolor%>>    
        <td width="30%">头像*<img id=face src="<%=rs("face")%>" alt=个人形象代表 width=<%=rs("width")%> height=<%=rs("height")%>></td>   
        <td width="70%">    
                <select name=face size=1 onChange="document.images['face'].src=options[selectedIndex].value;">
<option value='pic/Image1.gif'>Image1</option><option value='pic/Image2.gif'>Image2</option>
<option value='pic/Image3.gif'>Image3</option><option value='pic/Image3.gif'>Image3</option>
<option value='pic/Image4.gif'>Image4</option><option value='pic/Image5.gif'>Image5</option>
<option value='pic/Image6.gif'>Image6</option><option value='pic/Image7.gif'>Image7</option>
<option value='pic/Image8.gif'>Image8</option><option value='pic/Image9.gif'>Image9</option>
<option value='pic/Image10.gif'>Image10</option><option value='pic/Image11.gif'>Image11</option>
<option value='pic/Image12.gif'>Image12</option><option value='pic/Image13.gif'>Image13</option>
<option value='pic/Image14.gif'>Image14</option><option value='pic/Image15.gif'>Image15</option>
<option value='pic/Image16.gif'>Image16</option><option value='pic/Image17.gif'>Image17</option>
<option value='pic/Image18.gif'>Image18</option><option value='pic/Image19.gif'>Image19</option>
<option value='pic/Image20.gif'>Image20</option><option value='pic/Image21.gif'>Image21</option>
<option value='pic/Image22.gif'>Image22</option><option value='pic/Image23.gif'>Image23</option>

⌨️ 快捷键说明

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