📄 msgnew.asp
字号:
<!-- #include file="const.asp" -->
<%
call opendb()
checkuser()
dim sql,rs,name,action1,copy,title,content
action1=trim(request.Form("action1"))
name=trim1(request("name"))
if name<>"" then
sql="select messkey from m3_users where name='"&name&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
rs.close
set rs=nothing
call closedb()
response.write"<script>alert('无效的收件人帐号');history.back();</script>"
response.End()
else
if rs("messkey")=0 then
rs.close
set rs=nothing
call closedb()
response.write"<script>alert('该收件人拒绝接收任何信件!');window.close();</script>"
response.End()
end if
end if
rs.close
set rs=nothing
end if
if action1="DONE" then
copy=trim(request.Form("copy"))
title=trim(request.Form("title"))
content=trim(request.Form("content"))
if name="" then
response.write"<script>alert('无效的帐号名');history.back();</script>"
response.End()
end if
if title="" then
response.write"<script>alert('请输入标题!');history.back();</script>"
response.End()
end if
if content="" then
response.write"<script>alert('请输入内容');history.back();</script>"
response.End()
end if
if len(title)>100 then title=left(title,100)
if len(content)>1000 then content=left(content,1000)
title=server.HTMLEncode(title)
content=server.HTMLEncode(content)
set rs=server.CreateObject("adodb.recordset")
sql="select * from m3_message where owner='"&name&"'"
rs.open sql,conn,1,3
if rs.recordcount>30 then
response.write"<script>alert('发送信息失败: "&name&"的信箱已满!');history.back();</script>"
response.End()
else
rs.addnew
rs("to1")=name
rs("from1")=request.Cookies("matrix3")("matrix3_name")
rs("owner")=name
rs("valid")=1
rs("addtime")=now
rs("title")=title
rs("content")=content
rs("isnew")=1
rs.update
if copy="1" then
if name<>request.Cookies("matrix3")("matrix3_name") then
rs.addnew
rs("to1")=name
rs("from1")=request.Cookies("matrix3")("matrix3_name")
rs("owner")=request.Cookies("matrix3")("matrix3_name")
rs("valid")=1
rs("addtime")=now
rs("title")=title
rs("content")=content
rs.update
end if
end if
end if
rs.close
set rs=nothing
call closedb()
response.write"<script>alert('信息发送给 "&name&" 成功 !');window.close();self.opener.location.reload();</script>"
response.End()
else
position "撰写站内信件",0
call closedb()
%>
<html>
<head>
<title>发站内邮件</title>
<meta http-equiv="content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<BODY BGCOLOR=#FFFFFF>
<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#ECE9D9">
<tr background="images/bg4.gif" align="center">
<td background="images/bg4.gif"><b>发站内邮件</b></td>
</tr>
<tr height="20" align="center">
<td bgcolor="#FFFFFF" height="300" valign="top">
<br>
<form name="mform" method="post" onsubmit="return CheckForm();return false;">
<table width="500" border="0" cellspacing="1" cellpadding="3">
<tr height="20" bgcolor="#ECE9D9">
<td align="right" width="71" bgcolor="#FFFFFF" class=v7b height="20">来自:</td>
<td width="414" bgcolor="#FFFFFF" height="20">
<%=request.Cookies("matrix3")("matrix3_name")%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right" class=v7b>发住:</td>
<td>
<input name="name" type="text" class="input1" id="name" value='<%=request.QueryString("name")%>' size="20" maxlength="20">
(BBS帐号)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right" class=v7b>标题:</td>
<td>
<input name="title" type="text" class="input1" size="60" maxlength="100">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right"><span class="v7b">内容</span><br>
<br>
<span class="v8">(<1000字)</span></td>
<td>
<textarea name="content" cols="60" rows="10" class="input1"></textarea>
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="checkbox" name="copy" value="1">同时保留新发的信息到我的发件箱</td>
</tr>
<tr>
<td> </td>
<td height="40">
<input type="hidden" name="action1" value="DONE">
<input name="submit1" type="submit" class=v8 id="submit1" value=" 发送 ">
<input type="button" name="cancel" value="取消" onClick="javascript:window.close()" class=v8>
</td>
</tr>
</table>
<p>
<script language="JavaScript">
function CheckForm()
{
if(document.mform.name.value.length < 3){
alert('请输入收件人的BBS帐号');
return false;
}
if(document.mform.title.value.length <2){
alert('请输入标题');
return false;
}
if(document.mform.content.value.length <2){
alert('请输入信件内容');
return false;
}
document.mform.submit1.disabled=true;
document.mform.submit();
return true;
}
</script>
</p>
</form>
</td>
</tr>
<tr height="20" align="center">
<td> </td>
</tr>
</table>
</body></html>
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -