Flink_Add.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:8k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_InterFace/NS_Function.asp" -->
  5. <!--#include file="../../FS_Inc/Function.asp" -->
  6. <!--#include file="../Lib/strlib.asp" -->
  7. <%
  8. Response.Buffer = True
  9. Response.CacheControl = "no-cache"
  10. Dim tmp_type,sRootDir,str_CurrPath,obj_u_fl_rs
  11. MF_Default_Conn
  12. MF_User_Conn
  13. set obj_u_fl_rs = conn.execute("select top 1 IsOpen,IsRegister,ArrSize,isLock,Content From FS_FL_SysPara")
  14. if obj_u_fl_rs.eof then
  15. response.Write("找不到配置信息,请与管理员联系"):response.end
  16. else
  17. if obj_u_fl_rs("IsOpen")=0 then
  18. response.Write("没有开放友情连接申请")
  19. response.end
  20. end if
  21. if obj_u_fl_rs("IsRegister") = 1 then
  22. %>
  23. <!--#include file="../lib/UserCheck.asp" -->
  24. <%
  25. end if
  26. if G_VIRTUAL_ROOT_DIR<>"" then sRootDir="/"+G_VIRTUAL_ROOT_DIR else sRootDir=""
  27. if obj_u_fl_rs("IsRegister") = 1 then
  28. str_CurrPath = Replace(sRootDir &"/"&G_USERFILES_DIR&"/"&session("FS_UserNumber"),"//","/")
  29. End if
  30. if trim(Request.Form("edit_save"))<>"" then
  31. dim obj_save_Rs
  32. if trim(Request.Form("isread"))="" then
  33. Response.Write("<script>alert(""错误:n请同意注册须知"");location.href=""javascript:history.back()"";</script>")
  34. Response.End
  35. end if
  36. if trim(Request.Form("F_Name"))="" or trim(Request.Form("F_Type"))="" or trim(Request.Form("F_Url"))="" or trim(Request.Form("F_Url"))="http://" or trim(Request.Form("F_Content"))="" then
  37. Response.Write("<script>alert(""错误:n带*必须填写"");location.href=""javascript:history.back()"";</script>")
  38. Response.End
  39. end if
  40. if Request.Form("F_Type")="0" then
  41. if Request.Form("F_PicUrl")="" then
  42. Response.Write("<script>alert(""错误:n请填写图片"");location.href=""javascript:history.back()"";</script>")
  43. Response.End
  44. end if
  45. end if
  46. if len(trim(Request.Form("F_Content")))>300 then
  47. Response.Write("<script>alert(""错误:n站点描述不能超过300字"");location.href=""javascript:history.back()"";</script>")
  48. Response.End
  49. end if
  50. if len(trim(Request.Form("F_Content_des")))>300 then
  51. Response.Write("<script>alert(""错误:n申请理由不能超过300字"");location.href=""javascript:history.back()"";</script>")
  52. Response.End
  53. end if
  54. set obj_save_Rs = Server.CreateObject(G_FS_RS)
  55. obj_save_Rs.open "select * from FS_FL_FrendList where 1=2",Conn,1,3
  56. obj_save_Rs.addnew
  57. obj_save_Rs("F_Name") = NosqlHack(Request.Form("F_Name"))
  58. if Request.Form("F_Type")="0" then:obj_save_Rs("F_Type") =0:else:obj_save_Rs("F_Type") =1:end if
  59. obj_save_Rs("F_Url") = Request.Form("F_Url")
  60. obj_save_Rs("F_Content") = Request.Form("F_Content")
  61. if Request.Form("F_Type")="0" then:obj_save_Rs("F_PicUrl") = Request.Form("F_PicUrl"):end if
  62. if trim(obj_u_fl_rs("isLock"))=1 then:obj_save_Rs("F_Lock") =1:else:obj_save_Rs("F_Lock") = 0:end if
  63. obj_save_Rs("F_OrderID") = 0
  64. obj_save_Rs("F_IsUser") = 1
  65. if obj_u_fl_rs("IsRegister") = 1 then
  66. obj_save_Rs("F_Author") = session("FS_UserNumber")
  67. else
  68. obj_save_Rs("F_Author") = Request.Form("F_Author")
  69. obj_save_Rs("F_Mail") = Request.Form("F_Mail")
  70. end if
  71. obj_save_Rs("F_Content_des") = Request.Form("F_Content_des")
  72. obj_save_Rs("F_LinkContent") = Request.Form("F_LinkContent")
  73. obj_save_Rs("F_isAdmin") = 0
  74. if trim(Request.Form("ClassID"))="" then:obj_save_Rs("ClassID") = 0:else:obj_save_Rs("ClassID") = Request.Form("ClassID"):end if
  75. obj_save_Rs("Addtime") = now
  76. obj_save_Rs.update
  77. obj_save_Rs.close:set obj_save_Rs = nothing
  78. Response.Write("<script>alert(""恭喜:n提交成功"");location.href=""Flink_Add.asp"";</script>")
  79. Response.End
  80. end if
  81. %>
  82. <html>
  83. <HEAD>
  84. <TITLE>FoosunCMS</TITLE>
  85. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  86. </HEAD>
  87. <%if Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")<>"" then%>
  88. <link href="../images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  89. <%else%>
  90. <link href="../images/skin/Css_2/2.css" rel="stylesheet" type="text/css">
  91. <%end if%>
  92. <BODY>
  93. <script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
  94. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  95.   <form name="form1" method="post" action="" onSubmit="return checksinput();">
  96.     <tr> 
  97.       <td colspan="2" class="xingmu">友情链接申请</td>
  98.     </tr>
  99.     <tr> 
  100.       <td class="hback"><div align="right">阅读申请须知</div></td>
  101.       <td class="hback"><input name="isread" type="checkbox" id="isread" value="1">
  102.         我已经阅读  <a href="#" id=item$pval[CatID]) style="CURSOR: hand"  onmouseup="opencat(id_fl);" onMouseOver="this.className='bg'" onMouseOut="this.className='bg1'" language=javascript>查看阅读须知</a></td>
  103.     </tr>
  104.     <tr id="id_fl" style="display:none;"> 
  105.       <td class="hback"><div align="right">申请须知</div></td>
  106.       <td class="hback"><% = obj_u_fl_rs("Content") %></td>
  107.     </tr>
  108.     <tr> 
  109.       <td class="hback"><div align="right">类别</div></td>
  110.       <td class="hback"> <select name="ClassID" id="ClassID">
  111.           <option value="">不选择栏目</option>
  112.           <%dim obj_list_rs
  113.   set obj_list_rs=conn.execute("select id,F_ClassCName from FS_FL_Class order by id desc")
  114.   do while not obj_list_rs.eof
  115. Response.Write "<option value="""& obj_list_rs("id") &""">"& obj_list_rs("F_ClassCName") &"</option>"
  116.   obj_list_rs.movenext
  117.   loop
  118.   obj_list_rs.close:set obj_list_rs = nothing
  119.   %>
  120.         </select></td>
  121.     </tr>
  122.     <tr> 
  123.       <td width="27%" class="hback"><div align="right">站点名称</div></td>
  124.       <td width="73%" class="hback"><input name="F_Name" type="text" id="F_Name" size="40">
  125.         *</td>
  126.     </tr>
  127.     <tr> 
  128.       <td class="hback"><div align="right">链接类型</div></td>
  129.       <td class="hback"> <input name="F_Type" type="radio" value="1" checked >
  130.         文字链接 
  131.           <input type="radio" name="F_Type" value="0">
  132.         图片链接*</td>
  133.     </tr>
  134.     <tr> 
  135.       <td class="hback"><div align="right">链接地址</div></td>
  136.       <td class="hback"><input name="F_Url" type="text" id="F_Url" size="40">
  137.         *</td>
  138.     </tr>
  139.     <tr> 
  140.       <td class="hback"><div align="right">站点说明</div></td>
  141.       <td class="hback"><textarea name="F_Content" rows="5" id="F_Content" style="width:60%"></textarea>
  142.         最多300个字符*</td>
  143.     </tr>
  144.     <tr> 
  145.       <td class="hback"><div align="right">图片地址</div></td>
  146.       <td class="hback"><input name="F_PicUrl" type="text" id="F_PicUrl" size="42"> 
  147.         <%if obj_u_fl_rs("IsRegister") = 1 then %>
  148.         <input type="button" name="PPPChoose"  value="选择图片" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPic.asp?CurrPath=<%=str_CurrPath %>',500,300,window,document.form1.F_PicUrl);">
  149.         <%end if%></td>
  150.     </tr>
  151.     <tr> 
  152.       <td class="hback"><div align="right">申请人作者(编号)</div></td>
  153.       <td class="hback"><input name="F_Author" type="text" id="F_Author" value="<%=session("FS_UserNumber")%>"></td>
  154.     </tr>
  155.     <tr> 
  156.       <td class="hback"><div align="right">申请人电子邮件</div></td>
  157.       <td class="hback"><input name="F_Mail" type="text" id="F_Mail2" value="<%=session("FS_UserEmail")%>"></td>
  158.     </tr>
  159.     <tr> 
  160.       <td class="hback"><div align="right">申请理由</div></td>
  161.       <td class="hback"><textarea name="F_Content_des" rows="5" id="textarea" style="width:60%"></textarea>
  162.         最多300个字符</td>
  163.     </tr>
  164.     <tr> 
  165.       <td class="hback"><div align="right"></div></td>
  166.       <td class="hback"><input type="submit" name="Submit" value="提交信息" > <input type="reset" name="Submit2" value="重置"> 
  167.         <input name="edit_save" type="hidden" id="edit_save" value="add_save"></td>
  168.     </tr>
  169.   </form>
  170. </table>
  171. </body>
  172. </html>
  173. <%
  174. set obj_u_fl_rs=nothing
  175. end if
  176. %><script language="JavaScript" type="text/JavaScript">
  177. function opencat(cat)
  178. {
  179.   if(cat.style.display=="none"){
  180.      cat.style.display="";
  181.   } else {
  182.      cat.style.display="none"; 
  183.   }
  184. }
  185. function checksinput()
  186. {
  187. if(document.form1.isread.checked==false)
  188. {
  189.  alert('请同意阅读协议');
  190.  return false;
  191. }
  192. if(document.form1.F_Name.value=='')
  193. {
  194.  alert('填写站点标题');
  195.  form1.F_Name.focus();
  196.  return false;
  197. }
  198. if(document.form1.F_Url.value=='')
  199. {
  200.  alert('填写站点链接地址');
  201.  form1.F_Url.focus();
  202.  return false;
  203. }
  204. if(document.form1.F_Content.value=='')
  205. {
  206.  alert('填写站点说明');
  207.  form1.F_Content.focus();
  208.  return false;
  209. }
  210. }
  211. </script>