edit.asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:5k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <!--#include file="conn.asp"-->
  2. <%if session("admin")="" then
  3. response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
  4. response.End
  5. else
  6. end if
  7. %>
  8. <%
  9. NewsID=request("id")
  10. if NewsID<>"" then
  11. if not isnumeric(NewsID) then 
  12. response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
  13. response.end
  14. end if
  15. end if
  16. if NewsID="" then
  17. %>
  18. <script language=javascript>
  19. history.back()
  20. alert("请输入您要修改的文章ID!")
  21. </script>
  22. <%
  23. Response.End
  24. end if
  25. set rs=server.CreateObject ("ADODB.RecordSet")
  26. rs.Source="select * FROM kind where anclassid=" & NewsID
  27. rs.Open rs.source,conn,1,1
  28. if rs.recordcount=0 then
  29. %>
  30. <script language=javascript>
  31. history.back()
  32. alert("非法文章ID,请确认NewsID不超出当前范围!")
  33. </script>
  34. <%
  35. Response.End
  36. end if
  37. %>
  38. <html>
  39. <head>
  40. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  41. <link href="../images/css.css" rel="stylesheet" type="text/css">
  42. <script language="javascript">
  43. <!--
  44. function checkdata()
  45. {
  46. if (document.form1.title.value=="")
  47. {
  48.   alert("对不起,请输入文章标题!")
  49.   document.form1.title.focus()
  50.   return false
  51.  }
  52. if (document.form1.viewhtml.checked == true)
  53. {
  54.   alert("对不起,请取消“查看HTML源代码”后再添加!")
  55.   document.form1.viewhtml.focus()
  56.   return false
  57.  }
  58. if (document.form1.Content.value.length==0)
  59. {
  60.   alert("对不起,请输入文章内容!")
  61.   //document.form1.content.focus()
  62.   return false
  63.  }
  64. }
  65. function MM_goToURL() { //v3.0
  66.   var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  67.   for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
  68. }
  69. function MM_openBrWindow(theURL,winName,features) { //v2.0
  70.   window.open(theURL,winName,features);
  71. }
  72. //-->
  73. </script>
  74. <script  language="JavaScript">
  75. <!-- Hide from older browsers...
  76. //Function to format text in the text box
  77. function FormatText(command, option){
  78.    frames.message.document.execCommand(command, true, option);
  79.    frames.message.focus();
  80. }
  81. //Function to add image
  82. function AddImage(){
  83. imagePath = prompt('请输入图片地址', 'http://');
  84. if ((imagePath != null) && (imagePath != "")){
  85. frames.message.document.execCommand('InsertImage', false, imagePath);
  86.    frames.message.focus();
  87. }
  88. frames.message.focus();
  89. }
  90. //Function to clear form
  91. function ResetForm(){
  92. if (window.confirm('确认要清空对话框内容?')){
  93.   frames.message.document.body.innerHTML = ''; 
  94.   return true;
  95.  } 
  96.  return false;
  97. }
  98. //Function to open pop up window
  99. function openWin(theURL,winName,features) {
  100.    window.open(theURL,winName,features);
  101. }
  102. function setMode(newMode)
  103. {
  104.   bTextMode = newMode;
  105.   var cont;
  106.   if (bTextMode) {
  107.     cleanHtml();
  108.     cleanHtml();
  109.     cont=message.document.body.innerHTML;
  110.     message.document.body.innerText=cont;
  111.   } else {
  112.     cont=message.document.body.innerText;
  113.     message.document.body.innerHTML=cont;
  114.   }
  115.   message.focus();
  116. }
  117. function cleanHtml()
  118. {
  119.   var fonts = message.document.body.all.tags("FONT");
  120.   var curr;
  121.   for (var i = fonts.length - 1; i >= 0; i--) {
  122.     curr = fonts[i];
  123.     if (curr.style.backgroundColor == "#ffffff") curr.outerHTML = curr.innerHTML;
  124.   }
  125. }
  126. // -->
  127. </script>
  128. <script language="JavaScript">
  129. function help()
  130. {
  131.     var helpmess;
  132.     helpmess="---------------填写帮助---------------rnrn"+
  133.          "1.请不要发表有危险性的脚本。rnrn"+
  134.          "2.如果要书写源代码,请选中rnrn"+
  135.          " 查看HTML源代码书写.rnrn"+
  136.          "3.需要你自己运行,才能看效果.rnrn"+
  137.          "4.如果书写js,尽量不要在这儿书写.rnrn";
  138.     alert(helpmess);
  139. }
  140. </script>
  141. <script src="edit.js" type="text/javascript"></script>
  142. </head>
  143. <body>
  144. <form name="form1" method="post" action="edit_ok.asp" OnSubmit="return checkdata()" onReset="return ResetForm();">
  145.   <table class="tableBorder" width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
  146.     <tr> 
  147.       <td colspan="4" align="center" background="../images/admin_bg_1.gif"><b><font color="#ffffff"><%=rs("anclass")%>--版块内容</font></b></td>
  148.     </tr>
  149.     <tr> 
  150.       <td align="right" valign="top" class="TableBody1"><%=rs("anclass")%>--版块内容:</td>
  151.       <td class="forumRowHighlight" style="PADDING-LEFT: 10px"><textarea name="Contentt" style="display:none"><%=Server.HTMLEncode(rs("content"))%></textarea> 
  152.         <iframe ID="content" src="editubb/ewebeditor.asp?id=Contentt&style=standard" frameborder="0" scrolling="no" width="550" HEIGHT="350"></iframe>
  153.          </td>
  154.     </tr>
  155.     <tr > 
  156.       <td height="30" class="TableBody"></td>
  157.       <td class="TableBody2" bgcolor="<%=m_top%>"> <input type="submit" value=" 修 改 " name="Submit" class="unnamed5" OnClick="document.form1.Content.value = frames.message.document.body.innerHTML;">
  158.           <input type="reset" value=" 清 除 " name="Reset" class="unnamed5">
  159.           <input type="button" value=" 返 回 " onClick="javascript:history.go(-1)" class="unnamed5"> 
  160.         <input type="hidden" name="Content" value=""> <input type="hidden" name="linkaddress" value="<%=request.servervariables("http_referer")%>"> 
  161.         <input type="hidden" name="newsid" value="<%=NewsID%>"> </td>
  162.     </tr>
  163.   </table>
  164. </form>
  165. <!--#include file="foot.asp"-->
  166. </body>
  167. </html>