?? postadd.asp
字號(hào):
<%@LANGUAGE="VBScript" CODEPAGE="936"%>
<!--#include file="session.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="CHAR.asp" -->
<%
'發(fā)表帖子
If request.ServerVariables("REQUEST_METHOD")="POST" then
if session("usergroup")=1 then
response.write"<script>alert('對(duì)不起,您還沒(méi)有經(jīng)過(guò)同學(xué)驗(yàn)證,無(wú)權(quán)發(fā)布消息!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
response.end
end if
PostID=request("PostID")
PostTitle=trim(request("PostTitle"))
PostText=trim(request("MssgText"))
set rs1=server.CreateObject("adodb.recordset")
if PostID="" then
rs1.open "bbs",conn,1,3
rs1.addnew
rs1("PostTitle")=PostTitle
rs1("PostText")=PostText
rs1("PostUser")=session("username")
rs1("PostTime")=now()
rs1("ReplyTime")=now()
rs1("posthits")=0
rs1("ReplyNo")=0
rs1.update
rs1.close
set rs1=nothing
strsql="select top 1 PostID from bbs order by replyTime desc"
set rs1=conn.execute(strsql)
Postid=rs1("PostID")
rs1.close
set rs1=nothing
CloseDatabase
response.Redirect("postdisplay.asp?id="&Postid)
else
sql1="select * from bbs where PostID="&Postid
rs1.open sql1,conn,2,3
rs1("PostTitle")=PostTitle
rs1("PostText")=PostText
rs1.update
rs1.close
set rs1=nothing
CloseDatabase
response.Redirect("postdisplay.asp?id="&Postid)
end if
end if
id=request("id")
if id<>"" or IsNumeric(id)=False then
strsql="select * from bbs where PostID="&id
set rs=conn.execute(strsql)
If rs("PostUser")=Session("UserName") or session("usergroup")=3 Then
PostID=trim(rs("PostID"))
PostTitle=trim(rs("PostTitle"))
PostText=trim(rs("PostText"))
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%>同學(xué)錄--發(fā)表留言</title>
<link href="css/class.css" type=text/css rel=stylesheet>
<script language="JavaScript">
<!--
function checkform()
{if (document.post.PostTitle.value.length==0) {
alert("標(biāo)題不能為空!");
document.post.PostTitle.focus();
return false;
}
if (document.post.MssgText.value.length==0) {
alert("內(nèi)容不能為空!");
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%>同學(xué)錄" 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">您的位置>發(fā)表主題</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/bjbj.gif">
<tr>
<td width="135"><img src="images/bjlt.gif" width="135" height="36"></td>
<td> </td>
<td width="85"><img src="images/hfht2.gif" width="85" 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="postadd.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>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -