📄 forumpri.asp
字号:
<%@ Language=VBScript %>
<%if not session("user_session_id")=Session.SessionID then%>
<SCRIPT LANGUAGE=javascript>
parent.window.location.href="default.asp"
</SCRIPT>
<%end if%>
<html>
<head>
<LINK href="inc/css.css" type=text/css rel=stylesheet>
<style TYPE="text/css">
<!--
.popcomments
{
position : absolute; width:130;
visibility : hidden;
border: 1 solid #000001
}
.in
{
BORDER-RIGHT: rgb(127,127,127) 1px solid;
BORDER-TOP: rgb(127,127,127) 1px solid;
FONT-SIZE: 9pt;
BORDER-LEFT: rgb(127,127,127) 1px solid;
BORDER-BOTTOM: rgb(127,127,127) 1px solid;
BACKGROUND-COLOR: #ffffff
}
//-->
</style>
<SCRIPT LANGUAGE=javascript>
<!--
function openScript(url){
var Win = window.open(url,"openScript",'resizable=1,scrollbars=yes,menubar=no,status=no' );
}
function toreply(id){
window.open('toreply.asp?id='+id,'','resizable=1,scrollbars=yes,menubar=no,status=no,width=350,height=300')
}
function selectAll(){
for (var i=0;i<document.form0.elements.length;i++){
var e = document.form0.elements[i];
if (e.name== 'applyno')
e.checked=document.form0.del.checked;
}
}
function todel(){
var logo
for (i=0;i<document.form0.elements.length;i++){
e = document.form0.elements[i];
if(e.name== 'applyno'&&e.checked==true){
logo=true;
break;
}
else
logo=false;
}
if(logo){
if (confirm("你确实要删除所选择的留言吗?")){
window.document.form0.action="delforpri.asp"
window.document.form0.submit()
}
}
else
alert("请你选择留言记录!")
}
//-->
</SCRIPT>
<script language="javascript">
function stringTrim() {
var strTemp = this;
var spaceChar = " ";
while (strTemp.charAt(0) == spaceChar) {strTemp = strTemp.substr(1)};
while (strTemp.charAt(strTemp.length-1) == spaceChar) {strTemp = strTemp.substr(0,strTemp.length-1)};
return strTemp.toString();
}
String.prototype.trim = stringTrim;
function goto2(){
var s1=document.form2.towho.value.trim()
var s2=document.form2.content.value.trim()
if (s1==""||s1=="<%=ecid%>"){
window.alert ("请填入学号并且不能给自己发信!\n谢谢!")
document.form2.towho.select()
return false;
}
if (s2==""){
window.alert ("请留言!\n谢谢!")
document.form2.content.select()
return false;
}
if(s2.length>150){
window.alert("留言内容不能超过150字!");
window.document.form2.content.select()
return false;
}
document.form2.submit()
}
</script>
<title>校友录-我的收件箱</title>
</head>
<body leftMargin=0 topMargin=0>
<!--#include file=inc/top.asp-->
<%
function sort(data)
sort=Replace(data,"'","''")
end function
If Request.Form ("hid")<>"" Then
Dim towho,content
towho=sort(Request.Form ("towho"))
content=sort(Request.Form ("content"))
content=Trim(Request.Form ("content"))
content=Replace(content,VBCrlf,"<br>")
set rst=session("cn").execute ("select studentid from ec where studentid='"&towho&"'")
if not rst.EOF then
sql="insert into forum(studentid,content,pubtime,towho) values('"&session("ecid")&"','"&content&"','"&now()&"','"&towho&"')"
session("cn").execute (sql)
else
%>
<script>
alert("<%=towho%>不存在!")
location.href ="forumpri.asp"
</script>
<%
Response.End
end if %>
<script>
alert("<%=towho%>的信已经成功发送!")
</script>
<%
End IF
%>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="498" valign="top">
<%
Response.Cookies ("myletter")=0
Dim sql,rst,curpage,sql2
sql="select ec.studentid,ec.sname,ec.pic,forum.content,forum.pubtime,forum.id from ec,forum "&_
" where forum.towho='"&session("ecid")&"' and ec.studentid=forum.studentid order by pubtime desc"
sql2="update forum set isread=1 where towho='"&ecid&"'"
session("cn").execute sql2
Set rst=Server.CreateObject ("ADODB.Recordset")
rst.open sql,session("cn")
%>
<br>
<form name="form0" method="post" action="">
<table width="504" border="1" cellspacing="0" cellpadding="0" bordercolor="#99CCFF">
<tr align="center">
<td width="36">留言号</td>
<td width="43">发信人</td>
<td width="29">回复</td>
<td width="236">内容</td>
<td width="66">时间</td>
<td width="76">删除</td>
</tr>
<% IF rst.eof Then
Response.Write "<tr align=center><td colspan=5>当前无人为你留言!</td></tr>"
Else
Dim i
i=1
while not rst.EOF
%>
<tr>
<td width="36" align="center" height="12"><b><%=i%></b></td>
<td width="43" align="center" height="12"><%=rst(1)%></td>
<td width="29" height="12" align="center">
<a href="javascript:toreply('<%=rst(5)%>')">
<img src="IMAGES/edit.gif" width="16" height="15" border="0">
</a></td>
<td width="236" valign="top" height="12"><%=rst(3)%></td>
<td width="66" height="12" align="center"><%=rst(4)%></td>
<td width="76" height="12" align="center">
<input type="checkbox" name="applyno" value="<%=rst(5)%>">
删除 </td>
</tr>
<%
i=i+1
rst.MoveNext
wend
end if%>
</table>
<br>
<input type="checkbox" name="del" value="checkbox" onClick="selectAll()" >
全部选定
<input type="button" name="shanchu" value="删除所选留言" onClick="todel()" class=in>
</form>
<form method="POST" action="forumpri.asp" id=form2 name=form2 >
<input type=hidden name=ecid value=<%=session("ecid")%>>
<p>请留言:<br>
TO:(<font color=red>对方用户名</font>)
<input name=towho class=in>
<br>
留言内容:
<font color=red>留言字数不要超过150</font><br>
<textarea rows="8" name="content" cols="45" class=in></textarea>
</p>
<p>
<input type=hidden name=hid value="ok">
<input type="button" value="提交" name="B1" class=in onclick="javascript:goto2()">
<input type="reset" value="全部重写" name="B2" class=in>
</p>
</form>
</td>
</tr>
</table>
<% rst.Close
set rst=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -