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

📄 editavatar.asp

📁 很好的一个论坛原代码
💻 ASP
字号:
<%
if not session("sfadmin") then response.redirect("welcome.asp")
%>
<!--#INCLUDE FILE="../inc/db_inc.asp"-->
<!--#INCLUDE FILE="../inc/md5_inc.asp"-->
<!--#INCLUDE FILE="../inc/char_inc.asp"-->

<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK rel="stylesheet" href="image/style.css" type="text/css">
</HEAD>

<BODY bgcolor="#FFFFFF" text="#000000" leftmargin="10" topmargin="10">

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open StrConn
%>
<!--#INCLUDE FILE="checkadmin.asp"-->
<%

if request("step") = "2" then

	errstr = ""
	
	if request("title") = "" then errstr = errstr & "<LI>头像别名不能为空<BR>"
	if request("avatarpath") = "" then errstr = errstr & "<LI>头像图片路径不能为空<BR>"
	
	if errstr = "" then
		strsql = "update sf_avatar set title='" & chksql(request("title")) & "', avatarpath='" & chksql(request("avatarpath")) & "' where avatarid =" & chksql(request("avatarid"))
		Conn.Execute(strsql)
%>
<TABLE width="100%" border="0" cellspacing="1" cellpadding="4" align="center">
  <TR> 
    <TD bgcolor="#D1E3BF" align="center">编辑头像信息完毕</TD>
  </TR>
</TABLE>
<%
	else
%>
<TABLE width="100%" border="0" cellspacing="1" cellpadding="4" align="center">
  <TR> 
    <TD bgcolor="#D1E3BF">错误:<BR><%= errstr %></TD>
  </TR>
</TABLE>
<%
	end if

else
	errstr = ""
	if request("id") = "" then
		errstr = errstr & "<LI>参数不能为空<BR>"
	else
		strsql = "select * from sf_avatar where avatarid=" & chksql(request("id"))
		Set rs = Conn.Execute(strsql)
		if rs.bof or rs.eof then errstr = errstr & "<LI>错误的参数<BR>"
	end if
	if errstr = "" then
%>
<FORM name="form1" method="post" action="editavatar.asp">
  <TABLE width="100%" border="0" cellspacing="1" cellpadding="4" align="center">
    <TR> 
      <TD bgcolor="#D1E3BF" align="center" colspan="2"><B>编辑头像信息</B></TD>
    </TR>
    <TR bgcolor="#F5F5F5">
      <TD width="30%">头像别名</TD>
      <TD><INPUT type="text" name="title" size="30" value="<% = rs("title") %>"></TD>
    </TR>
    <TR bgcolor="#F5F5F5">
      <TD>头像路径</TD>
      <TD> 
        <INPUT type="text" name="avatarpath" size="30" value="<% = rs("avatarpath") %>"><BR>&nbsp;<BR>文件存放于论坛主目录的image/avatar子目录下</TD>
    </TR>
    <TR align="center"> 
      <TD colspan="2"> 
        <INPUT type="hidden" name="step" value="2">
        <INPUT type="hidden" name="avatarid" value="<% =request("id") %>">
        <INPUT type="submit" name="Submit" value="确 定">
      </TD>
    </TR>
  </TABLE>
</FORM>
<%
	else
%>
<TABLE width="80%" border="0" cellspacing="1" cellpadding="4" align="center">
  <TR> 
    <TD bgcolor="#D1E3BF">错误:<BR><%= errstr %></TD>
  </TR>
</TABLE>
<%
	end if
	
end if

%>
</BODY>
</HTML>

⌨️ 快捷键说明

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