📄 edit.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/char.asp"-->
<!--#include file="inc/email.asp"-->
<!--#include file="inc/const1.asp"-->
<!--#include file="inc/const2.asp"-->
<% dim guestdate
guestdate=request("time")
set rs=server.createobject("adodb.recordset")
sql="select * from [guest] where guestdate='"&GuestDate&"'"
rs.open sql,conn,1,3
if request("update")="提交" and rs("ip")=Request.ServerVariables("REMOTE_ADDR") then
if request("guestname")="" or strLength(request("guestname"))>20 then
errmsg=errmsg+"<br>"+"<li>请输入您的用户名(长度不能大于20)。"
founderr=true
else
guestname=trim(request("guestname"))
end if
if request("face")="" then
errmsg=errmsg+"<br>"+"<li>请选择您的头像。"
founderr=true
else face=request("face")
end if
'#################自己写了个版主防假冒
session("guestname")=trim(request("guestname"))
if session("guestname")=admin_name then
response.redirect"add.asp"
end if
if len(request("guestcontent"))>maxlen then
errmsg=errmsg+"<br>"+"<li>留言内容太多,不要乱灌水。"
founderr=true
end if
'#################防修改时加太多留言
if guestname=admin_id then
guestname=admin_name
end if
if request("emai")<>"" and IsValidEmail(trim(request("email")))=false then
errmsg=errmsg+"<br>"+"<li>您的Email有错误。"
founderr=true
else
useremail=trim(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
if request("guestcontent")="" then
errmsg=errmsg+"<br>"+"<li>请请填写留言内容。"
founderr=true
else guestcontent=request("guestcontent")
end if
rs("guestname")=guestname
if request("from")<>"" then
rs("from")=(request("from"))
end if
if request("email")<>"" then
rs("email")=(request("email"))
end if
if request("homepage")<>"" then
rs("homepage")=(request("homepage"))
end if
if request("oicq")<>"" then
rs("oicq")=(request("oicq"))
end if
rs("guestdate")=NOW()
rs("secretly")=(request("secretly"))
rs("ip")=rs("ip")
rs("face")=face
rs("guestcontent")=guestcontent
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "index.asp"
else
if rs("ip")=Request.ServerVariables("REMOTE_ADDR") then
%>
<html>
<head>
<title>编辑留言</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="css.asp"--><script language=javascript>
ie4=(document.all)?true:false;
ns4=(document.layers)?true:false;
function toExit(){
var args=toExit.arguments;
var visible=args[0];
if(ns4){
theObj=eval("document.layers[\'"+args[1]+"\']");
if(theObj)theObj.visibility=visible;
}
else if(ie4){
if(visible=='show')visible='visible';
if(visible=='hide')visible='hidden';
theObj=eval("document.all[\'"+args[1]+"\']");
if(theObj)theObj.style.visibility=visible;
}
}
</script>
</head>
<body text="#000000"><div id=layer-1
style="HEIGHT: 149px; LEFT: 156px; POSITION: absolute; TOP: 7px; VISIBILITY: hidden; WIDTH: 589px; Z-INDEX: 1" onkeydown="if(event.keyCode==13 && event.ctrlKey)document.forms[0].submit()">
<table border=0 cellpadding=0 cellspacing=0 height=133
width=520>
<tbody>
<tr>
<td height=65 width="100%"> <table border=0 cellpadding=0 cellspacing=0 height=80 width="99%">
<tbody>
<tr>
<td height=57> <font
color=#ffffff>
<iframe border="0" frameborder="0" framespacing="0" maginwidth="0" maginheigh="0" width="520" height="150" scrolling="yes" src="avatars.asp" valign="top"></iframe>
</font></td>
</tr>
<tr align="center">
<td height=23 width="100%" bgcolor="#CCCCCC"><a
href="javascript:toExit('hide','layer-1')">关闭此窗口</a></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</div>
<!--#include file="top.asp"-->
<form action=edit.asp method=post>
<table cellpadding=0 cellspacing=0 border=0 width=650 bgcolor="<%=bordercolor%>" align=center>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr valign="middle" bgcolor=#CBD8FE>
<td height=22 colspan="2" align=center bgcolor="<%=add_leftbg%>"><b><font color="<%=add_fontcolor%>">发表留言(有</font><font color="#FF0000">*</font><font color="<%=add_fontcolor%>">号的必填)</font></b></td>
</tr>
<tr bgcolor=#CBD8FE>
<td width="30%" height="22" align="center" bgcolor="<%=add_leftbg%>"> <div align="right"><font color="<%=add_fontcolor%>"><b>你的姓名: </b></font></div></td>
<td width="70%" height="22" bgcolor="<%=infobg%>"> <input type="text" name="guestname" maxlength="10" size="19" value="<%=rs("guestname")%>">
<font color="#FF0000">*</font> </td>
</tr>
<tr bgcolor=#CBD8FE>
<td width="30%" height="22" align="center" bgcolor="<%=add_leftbg%>"> <div align="right"><font color="<%=add_fontcolor%>"><b>来自哪里: </b></font></div></td>
<td width="70%" height="22" bgcolor="<%=infobg%>"> <input type="text" name="from" maxlength="10" size="19" value="<%=rs("from")%>">
</td>
</tr>
<tr bgcolor=#CBD8FE>
<td width="30%" height="22" align="center" bgcolor="<%=add_leftbg%>"> <div align="right"><font color="<%=add_fontcolor%>"><b>主页地址: </b></font></div></td>
<td width="70%" height="22" bgcolor="<%=infobg%>"> <input type="text" name="homepage" value="<%=rs("homepage")%>" size="19">
</td>
</tr>
<tr bgcolor=#CBD8FE>
<td width="30%" height="22" align="center" bgcolor="<%=add_leftbg%>"> <div align="right"><font color="<%=add_fontcolor%>"><b>Email地址: </b></font></div></td>
<td width="70%" height="22" bgcolor="<%=infobg%>"> <input type="text" name="email" value="<%=rs("email")%>" size="19">
</td>
</tr>
<tr bgcolor=#CBD8FE>
<td width="30%" height="22" align="center" bgcolor="<%=add_leftbg%>"> <div align="right"><font color="<%=add_fontcolor%>"><b>OQ号码: </b></font></div></td>
<td width="70%" height="22" bgcolor="<%=infobg%>"> <input type="text" name="oicq" maxlength="8" value="<%=rs("oicq")%>" size="19">
</td>
</tr>
<tr bgcolor=#CBD8FE>
<td width="30%" height="39" align="center" bgcolor="<%=add_leftbg%>"> <div align="right"><font color="<%=add_fontcolor%>"><b>选择头像: </b></font></div></td>
<td width="70%" height="39" bgcolor="<%=infobg%>"> <select name=face size=1>
<% for i=1 to 30 %>
<option value='Image<%=i%>.gif'>Image<%=i%></option>
<%next%>
</select> <font color="#FF0000">*</font><a href="javascript:toExit('show','layer-1')"><font color="#0000FF">显示所有头像</font></a>
</td>
</tr>
<%
if len(secret)=1 then
%>
<tr>
<td width="220" align="center" height="20" bgcolor="<%=add_leftbg%>">
<p align="right"><font color="<%=add_fontcolor%>"><b>悄悄话: </b></font></td>
<td width="433" height="20" bgcolor="<%=infobg%>"> <select size="1" name="secretly">
<option selected value="">否</option>
<option value="1">是</option>
</select></td>
</tr>
<%end if%>
<tr bgcolor=#CBD8FE>
<td width="30%" height="22" align="center" valign="middle" bgcolor="<%=add_leftbg%>"> <div align="right"><font color="<%=add_fontcolor%>"><b>留言内容: </b></font></div></td>
<td width="70%" height="22" bgcolor="<%=infobg%>"> <textarea name="guestcontent" cols="45" rows="5" wrap="VIRTUAL"><%=rs("guestcontent")%></textarea>
<font color="#FF0000">*</font> </td>
</tr>
<tr bgcolor=#CBD8FE>
<td align=center height=27 colspan="2" bgcolor="<%=add_leftbg%>"> <input type="hidden" name="time" value="<%=request("time")%>">
<input type="submit" name="update" value="提交"><font color="<%=add_fontcolor%>">(Ctrl+Enter提交)</font> </td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<br>
<hr noshade width="650" color="#C0C0C0" size="1">
<!--#include file="bottom.asp"-->
</body>
</html>
<%
else
Response.Write "你无权编辑此留言。"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -