AddNewNote.asp
资源名称:eat.rar [点击查看]
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:7k
源码类别:
数据库编程
开发平台:
ASP/ASPX
- <% Option Explicit %>
- <!--#include file="../../FS_Inc/Const.asp" -->
- <!--#include file="../../FS_InterFace/MF_Function.asp" -->
- <!--#include file="../../FS_InterFace/ns_Function.asp" -->
- <!--#include file="../../FS_Inc/Function.asp" -->
- <%
- response.buffer=true
- Response.CacheControl = "no-cache"
- Dim Conn,User_Conn
- MF_Default_Conn
- 'session判断
- MF_Session_TF
- if not MF_Check_Pop_TF("WS002") then Err_Show
- %>
- <html>
- <HEAD>
- <TITLE>FoosunCMS留言系统</TITLE>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
- </HEAD>
- <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
- <body>
- <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
- <tr class="hback">
- <td align="left" colspan="2" class="xingmu">留言板 <a href="../../help?Lable=Message" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></td>
- </tr>
- <tr>
- <td colspan="2" class="hback"><a href="ClassMessageManager.asp">管理首页</a></td>
- </tr>
- </table>
- <form id="WriteNote" name="WriteNote" action="?Act=Add" method="post">
- <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
- <tr class="hback">
- <td class="hback" align="right" width="20%">贴子标题</td>
- <td class="hback" ><input type="test" name="Topic" size="20" maxlength="50"> <input type="checkbox" id="IsAdmin" name="IsAdmin" value="1">公管理员可见</td>
- </tr>
- <tr class="hback">
- <td class="hback" align="right" width="20%">贴子类型</td>
- <td class="hback" align="left"><input type="radio" name="Style" value="1">推荐帖子<input type="radio" name="Style" value="0" checked>普通帖子</td>
- </tr>
- <tr>
- <td class="hback" align="right" height="25">表情</td>
- <td class="hback" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td> <input name="FaceNum" type="radio" value="1" checked>
- <img src="Images/face1.gif" width="22" height="22"> </td>
- <td> <input type="radio" name="FaceNum" value="2"> <img src="Images/face2.gif" width="22" height="22"> </td>
- <td> <input type="radio" name="FaceNum" value="3"> <img src="Images/face3.gif" width="22" height="22"> </td>
- <td> <input type="radio" name="FaceNum" value="4"> <img src="Images/face4.gif" width="22" height="22"> </td>
- <td> <input type="radio" name="FaceNum" value="5"> <img src="Images/face5.gif" width="22" height="22"> </td>
- <td> <input type="radio" name="FaceNum" value="6"> <img src="Images/face6.gif" width="22" height="22"></td>
- <td> <input type="radio" name="FaceNum" value="7"> <img src="Images/face7.gif" width="22" height="22"> </td>
- <td> <input type="radio" name="FaceNum" value="8"> <img src="Images/face8.gif" width="22" height="22"> </td>
- <td> <input type="radio" name="FaceNum" value="9"> <img src="Images/face9.gif" width="22" height="22"></td>
- </tr>
- <tr>
- <td> <input type="radio" name="FaceNum" value="10"> <img src="Images/face10.gif" width="22" height="22"></td>
- <td> <input type="radio" name="FaceNum" value="11"> <img src="Images/face11.gif" width="22" height="22"> </td>
- <td> <input type="radio" name="FaceNum" value="12"> <img src="Images/face12.gif" width="22" height="22"></td>
- <td> <input type="radio" name="FaceNum" value="13"> <img src="Images/face13.gif" width="22" height="22"> </td>
- <td> <input type="radio" name="FaceNum" value="14"> <img src="Images/face14.gif" width="22" height="22"></td>
- <td> <input type="radio" name="FaceNum" value="15"> <img src="Images/face15.gif" width="22" height="22"></td>
- <td> <input type="radio" name="FaceNum" value="16"> <img src="Images/face16.gif" width="22" height="22"></td>
- <td> <input type="radio" name="FaceNum" value="17"> <img src="Images/face17.gif" width="22" height="22"> </td>
- <td> <input type="radio" name="FaceNum" value="18"> <img src="Images/face18.gif" width="22" height="22"> </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr class="hback">
- <td class="hback" align="right">帖子内容</td>
- <td class="hback" valign="top" ><textarea name="Content" id="Content" rows="8" cols="25"></textarea></td>
- </tr>
- <tr class="hback">
- <td class="hback"> <input type="hidden" name="ClassID" ID="ClassID" value="<%=Request.querystring("ClassID")%>"></td>
- <td class="hback"><input type="submit" name="submit" value="OK发表贴子">
- <input type="reset" name="reset" value=" 清 空 "></td>
- </tr>
- </table>
- </form>
- <%
- dim ClassID,NoteRs,Topic,Content,Face,IsUser,isTop,IsAdmin,strShowErr
- Set NoteRs=Server.CreateObject(G_FS_RS)
- if NoSqlHack(Request.QueryString("Act"))="Add" then
- ClassID=NoHtmlHackInput(Request.form("ClassID"))
- Topic=NoHtmlHackInput(trim(Replace(Request.form("Topic"),"'","")))
- IsTop=NoHtmlHackInput(trim(Request.form("Style")))
- Content=NoHtmlHackInput(Trim(Request.form("Content")))
- IsAdmin=NoHtmlHackInput(Trim(Request.form("IsAdmin")))
- if IsAdmin="" then
- IsAdmin="0"
- end if
- if ClassID="" then
- strShowErr = "<li>参数出错!</li>"
- Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
- Response.end
- end if
- if Topic="" then
- strShowErr = "<li>标题不能为空!</li>"
- Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
- Response.end
- end if
- if isTop="" then
- strShowErr = "<li>帖子类型值没传过来!</li>"
- Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
- Response.end
- end if
- if Content="" then
- strShowErr = "<li>内容不能为空!</li>"
- Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
- Response.end
- end if
- NoteRs.open "Select ClassID,User,Topic,Body,AddDate,IsTop,State,Style,IsAdmin,Hit,LastUpdateUser,Face,IP from FS_WS_BBS where 1=2",Conn,1,3
- NoteRs.Addnew
- NoteRs("ClassID")=ClassID
- NoteRs("User")=session("Admin_Name")
- NoteRs("Topic")=Topic
- NoteRs("Body")=Content
- NoteRs("AddDate")=now()
- NoteRs("IsTop")=IsTop
- NoteRs("Style")="普通"
- NoteRs("IsAdmin")=IsAdmin
- NoteRs("Face")=Request.Form("FaceNum")
- NoteRs("LastUpdateUser")=session("Admin_Name")
- NoteRs("IP")=Request.ServerVariables("REMOTE_ADDR")
- NoteRs.update
- Set NoteRs=nothing
- strShowErr = "<li>发帖成功</li>"
- Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=bbs/ClassMessageManager.asp")
- Response.end
- end if
- Response.end
- Set Conn=nothing
- %>
- </body>
- </html>