?? msgadd.asp
字號:
<%@LANGUAGE="VBScript" CODEPAGE="936"%>
<!--#include file="SESSION.asp" -->
<!--#include file="CONN.asp" -->
<!--#include file="CHAR.asp" -->
<%
'添加,更新記錄
if request.ServerVariables("REQUEST_METHOD")="POST" then
if session("usergroup")=1 then
response.write"<script>alert('對不起,您還沒有經過同學驗證,無權發布消息!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
response.end
end if
MssgID=request.Form("MssgID")
MssgText=HTMLEncode(trim(request.Form("MssgText")))
set rs1=server.CreateObject("adodb.recordset")
if MssgID="" then '增加記錄
rs1.open "mssg",conn,1,3
rs1.addnew
rs1("MssgUser")=session("username")
rs1("MssgText")=MssgText
rs1("MssgTime")=now()
rs1.update
rs1.close
set rs1=nothing
CloseDatabase
response.Redirect("msgboard.asp")
else
strsql="select MssgText from [mssg] where MssgID="&mssgid
rs1.open strsql,conn,2,3
rs1("MssgText")=MssgText
rs1.update
rs1.close
set rs1=nothing
CloseDatabase
response.Redirect("msgboard.asp")
end if
end if
id=request.QueryString("id")
if id<>"" then
strsql="select * from mssg where MssgID="&id
set rs=conn.execute(strsql)
If rs("MssgUser")=Session("UserName") or session("usergroup")=3 Then
mssgid=trim(rs("MssgID"))
MssgText=trim(rs("MssgText"))
Else
response.Redirect("error.asp")
End If
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<title><%=classname%>同學錄--發表留言</title>
<link href="css/class.css" type=text/css rel=stylesheet>
<script language="JavaScript">
<!--
function checkform()
{if (document.post.MssgText.value.length==0) {
alert("請發表您的留言!");
document.post.MssgText.focus();
return false;
}
if (document.post.MssgText.value.length>200) {
alert("您發表的留言大于所規定字數!");
document.post.MssgText.focus();
return false;
}
return true
}
//-->
</script>
<script language="JavaScript" src="js/ubb.js"></script>
</head>
<body background="images/1.GIF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><img src="images/top_t.gif" width="776" height="43"></td>
</tr>
<tr>
<td width="138"><img src="images/top_l.gif" width="138" height="39"></td>
<td width="584" align="right" bgcolor="#666B52"><a href="index.asp"><img src="images/toplogo.gif" alt="<%=classname%>同學錄" width="200" height="39" border="0"></a></td>
<td width="54"><img src="images/top_r.gif" width="54" height="39"></td>
</tr>
<tr>
<td colspan="3"><table width="776" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" rowspan="2" valign="top" background="images/left_x.gif"><img src="images/left_img.gif" width="120" height="480"></td>
<td rowspan="2" valign="top" bgcolor="#F2F2EA"> <div align="center">
<!--#include file="top.asp" -->
</div>
<table width="618" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"> <div align="center"><br>
<!--#include file="left.asp" -->
</div></td>
<td width="10"> </td>
<td width="418" valign="top"><table width="400" border="0" align="center" cellpadding="2" class="font1">
<tr>
<td width="459">您的位置>發表留言</td>
<td width="27"> </td>
</tr>
</table>
<div align="center">
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="400" border="0" cellpadding="0" cellspacing="0" background="images/gnymtbz.gif">
<tr>
<td width="135"><img src="images/fbly.gif" width="135" height="36"></td>
<td> </td>
<td width="100"><img src="images/gnymtyb.gif" width="100" height="36"></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="400" border="0" cellpadding="0" cellspacing="0" background="images/n_bk.gif">
<tr>
<td valign="top"> <table border="0" cellpadding="2" width="400" cellspacing="2">
<tr>
<td> <div align="center">
<form action="msgadd.asp" method="post" name="post" id="post" onSubmit="return checkform()">
<table border="0" cellpadding="2" width="388">
<tr>
<td width="380"> <table width="380" border="0" cellpadding="0" cellspacing="0" bgcolor="#666B52">
<tr>
<td><table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<td bgcolor="E3E3CF">
<div align="center"><strong>字體</strong>
<SELECT onchange=showfont(this.options[this.selectedIndex].value) name=font>
<option value="宋體" selected>宋體</option>
<option value="楷體_GB2312">楷體</option>
<option value="新宋體">新宋體</option>
<option value="黑體">黑體</option>
<option value="隸書">隸書</option>
<OPTION value="Andale Mono">Andale
Mono</OPTION>
<OPTION value=Arial>Arial</OPTION>
<OPTION value="Arial Black">Arial
Black</OPTION>
<OPTION value="Book Antiqua">Book
Antiqua</OPTION>
<OPTION value="Century Gothic">Century
Gothic</OPTION>
<OPTION value="Comic Sans MS">Comic
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -