编辑留言
function save_onclick()
{
document.form.Content.value=editor.HtmlEdit.document.body.innerHTML;
var strTemp = document.form.password.value;
if (strTemp.length == 0 )
{
alert("请填写密码");
document.form.password.focus();
return false;
}
var strTemp = document.form.Content.value;
if (strTemp.length == 0 )
{
alert("请填写留言内容");
return false;
}
return true;
}
function save_onclick1()
{
var strTemp = document.form.password.value;
if (strTemp.length == 0 )
{
alert("请填写密码");
document.form.password.focus();
return false;
}
var strTemp = document.form.Content.value;
if (strTemp.length == 0 )
{
alert("请填写留言内容");
return false;
}
return true;
}
rs.open "Select * From guest where id="&request("id"),Conn,2,3
if session("useridname")rs("username") then if session("admin")1 then if session("admin")2 then response.Redirect "error.asp?info=非作者本人不能修改!"
Set rs1=server.createobject("ADODB.RECORDSET")
rs1.open "Select * From option1" ,Conn,1,1
if request.Form"" then
rs.close
password=request.Form("password")
pic=request.Form("pic")
Subject =Request.Form("Subject")
content =Request.Form("content")
username=request.Form("username")
id=request.Form("id")
secret=request.Form("secret")
if secret1 then secret=0
content=replace(content,vbCrLf,"")
content=replace(content," "," ")
rs1.close
set rs1=nothing
lydate =now
if homepage="http://" then homepage=""
Set rs=server.createobject("ADODB.RECORDSET")
rs.open "Select * From register where username='" & username& "'" ,Conn,2,3
if session("admin")1 then if session("admin")2 then if md5(password)rs("password") then response.Redirect "error.asp?info=用户名或密码错误!"
rs.close
rs.open "Select * From guest where id=" & id,Conn,2,3
rs("subject")=subject
content=replace(content,"'","""")
rs("content")=content
rs("lydate")=lydate
rs("pic")=pic
rs("secret")=secret
rs.update
rs.close
response.Redirect "guest_edit_post_ok.asp?id="&id
set rs=nothing
conn.close
set conn=nothing
end if
recontent=rs("content")
recontent=replace(recontent,"",vbCrLf)
recontent=replace(recontent," "," ")
recontent=replace(recontent,"""","'")
%>
留言首页
编辑留言
用户名:
密码:
(必填,否则不能修改)
心情:
留言标题:
留言内容:
留言功能:
悄悄话(只有登录后才可看到自己的留言及回复的内容)
set rs=nothing
%>