⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 content_edit2.asp

📁 是一个关于小学信息化教育的平台,提供了学校论坛,和聊天室功能!
💻 ASP
字号:
<!--#include file="../../include/db.asp"-->
<!--#include file="../../include/admin_check.asp"-->
<!--#INCLUDE FILE="power.ASP"-->
<%
action=trim(request.querystring("action"))
Set conn = OpenOrGet_Database("sql_conn")
newsid=trim(Request("id"))



'得到项目列表
sql="select number,name from item_type where number='"&trim(request("type"))&"'"
Set itemRs=Open_rs(conn,sql)

function Deal(initstring)
	tempstring=replace(initstring,chr(39),"’")
	tempstring=Replace(tempstring,"<","&lt;")
	tempstring=Replace(tempstring,">","&gt;")
	tempstring=replace(tempstring,chr(34),"“")
	tempstring=replace(tempstring,chr(32),"&nbsp;")	
	deal=(tempstring)
end function

function Dealname(mystring)
    arrName=split(Cstr(mystring),chr(34))
Dealname=arrName(1)
end function

if action="add" or action="modi" then
	set ff=Server.CreateObject("LyfUpload.UploadFile")
	ff.maxsize=200000
	path=server.mappath("doc/")

'----------------------------------------deal attach01

if not dealname(ff.Request("picurl"))="" then
if instr(lcase(ff.Request("picurl")),".gif") or instr(lcase(ff.Request("picurl")),".jpg") or instr(lcase(ff.Request("picurl")),".bmp") then
	ss=ff.SaveFile("picurl",path,false)
	if ss= "0" then
				%>
				<script language="javascript">
				<!--
					alert("图片1:文件尺寸不应超过200K,请选择文件后重新上传");
					window.history.back(1);
				-->
				</script>
				<%
response.end
	end if
	if ss= "3" then
				%>
				<script language="javascript">
				<!--
					alert("图片1:服务器上已经有同名的文件,请选择文件后重新上传");
					window.history.back(1);
				-->
				</script>
				<%
response.end
	end if
	if ss = "" then
				%>
				<script language="javascript">
				<!--
					alert("图片1:文件上传失败!!");
					window.history.back(1);
				-->
				</script>
				<%
response.end
	end if
else
				%>
				<script language="javascript">
				<!--
					alert("图片1:文件必须为.bmp 文件或.jpg 文件或.gif 文件!!");
					window.history.back(1);
				-->
				</script>
				<%
response.end
end if
end if

downdir=""
if not ss="" then
'downdir="doc/"&ss
downdir=ss
end if

if downdir<>"" then
downdir="doc/"&downdir
end if

mytitle=transvalue(ff.request("title"))
apply_name=ff.request("apply_name")
if len(ff.request("type"))=1 then
depart_number="0"&ff.request("type")
else
depart_number=ff.request("type")
end if
'response.write depart_number
'response.end
apply_time=now

conn.execute "insert into content(title,user_name,type_id,attach,date)  values('"&mytitle&"','"&apply_name&"','"&depart_number&"','"&downdir&"','"&now&"')"


	      Response.Write "<script language=javascript>"
   		  Response.Write "alert('操作成功!!');"
    	  Response.Write "window.location.href='content2.asp?myjoke=1&type="&trim(ff.request("type"))&"&act=search';"
    	  Response.Write "</script>"
	 	  'Response.End

end if

booksql="select * from content where id='"&newsid&"'"

Set rs = Open_Rs(conn,booksql)
'rs.addnew
'rs.cancelupdate
      rs.AddNew


%>
<html>
<head>
<title>深圳育才一小欢迎您!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="/include/page.css" type="text/css">
</head>

<body >
<table width="1" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td> 
      <table width="753" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td><!--#include file="../../include/admin_banner.inc"--></td>
        </tr>
        <tr> 
          <td> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="1%">&nbsp;</td>
                <td width="99%"> 
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td id="td1">&nbsp;</td>
                    </tr>
                    <tr> 
                      <td> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="21%" valign="top"><!--#include file="../../include/admin_left.inc"--></td>
                            <td width="2%" valign="top">&nbsp;</td>
                            <td width="77%" height=1 valign="top"> 
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr> 
                                  <td> 
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr valign="top"> 
                                        <td background="/images/middle/m-bg.gif" width="70"><img src="/images/wzgl.gif"></td>
                                        <td background="/images/middle/m-bg.gif"  align="right"><img src="/images/middle/pacer1.gif" width="3" height="38"></td>
                                        <td background="/images/middle/m-bg.gif"  align="right" valign="middle" width="16"><a href=# onClick="more()"><img src="/images/middle/more.gif" width="16" height="16" border=0 alt="更多"></a></td>
                                        <td background="/images/middle/m-bg.gif"  align="right" width="8"><img src="/images/middle/pacer.gif" width="8" height="38"></td>
                                        <td background="/images/middle/m-bg.gif"  align="right" valign="middle" width="16"><a href=# onClick="help()"><img src="/images/middle/help.gif" width="16" height="16" border=0 alt="栏目帮助"></a></td>
                                        <td width="6" align="right"><img src="/images/middle/M-r.gif" width="16" height="38"></td>
                                      </tr>
                                    </table>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr> 
                                        <td class="bg-left" width="6"><img src="/images/left/l-l.gif" border=0></td>
                                        <td class="newsborder" width="100%" > 
                                          <table width="100%" border="0" cellspacing="1" cellpadding="0">
                                            <tr> 
                                              <td height="170" valign="top"> 
                                                <table border=0 cellpadding=0 cellspacing=0 align="center" width="100%" height="100%">
                                                  <form name=dataform method=post action='<%=Request.ServerVariables("PATH_INFO")%>?action=add'  enctype='multipart/form-data'>
                                                    <tr> 
                                                      <td class=tdsmall noWrap bgcolor="#f0f0e8"><br>
                                                        &nbsp;&nbsp;&nbsp;&nbsp;<b>项目名:</b></td>
                                                      <td bgcolor="#f0f0e8" class="tdsmall"><br>
                                                        <% response.write itemRs("name") %>
                                                        <input type=hidden name="type" value="<%=trim(request("type"))%>">
                                                      </td>
                                                    </tr>
                                                    <tr> 
                                                      <td class=tdsmall noWrap valign=top bgcolor="#f0f0e8"><br>
                                                        &nbsp;&nbsp;&nbsp;&nbsp;<b>标题:</b> 
                                                        <br>
                                                        &nbsp;</td>
                                                      <td bgcolor="#f0f0e8" class="tdsmall">
                                                        <input name=title type=text value='<%=rs("title")%>' style='HEIGHT: 22px; WIDTH: 150px'  class='edline' maxlength="50" >
                                                        <br>
                                                        &nbsp; </td>
                                                    </tr>
                                                    <tr> 
                                                      <td class=tdsmall noWrap valign=top bgcolor="#f0f0e8"><b><br>
                                                        &nbsp;&nbsp;&nbsp;&nbsp;图片:</b></td>
                                                      <td bgcolor="#f0f0e8" class="tdsmall"> 
                                                        <input type='file' name='picurl' style='height:22px;width:240px' class='edline' >
                                                        <%
selectsql="select username from bbs_user where id='"&session("userid")&"'"
set ApplyNameRs=open_rs(conn,selectsql)
if not (applyNameRs.eof and applyNameRs.bof) then
	response.write "<input type=hidden value='"&ApplyNameRs("username")&"' name=apply_name>"
else
	response.write "<input type=hidden value='未知人员' name=apply_name>"
end if
ApplyNameRs.close
set ApplyNameRs=nothing

%>
                                                        <br>
                                                        <br>
                                                        &nbsp; 
                                                        <input type=hidden name=id value=<%=rs("id")%>>
                                                      </td>
                                                    </tr>
                                                  </form>
                                                </table>
                                                <p align="center">&nbsp;</p>
                                                </td>
                                            </tr>
                                            <tr>
                                              <td height="20" valign="top"> 
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                  <tr align="center"> 
                                                    <td width="50%" height="30"> 
                                                                                                                     <table border=0 cellpadding=0 cellspacing=0>
                 
                <tr><td><img border=0   src="/images/left/s-l.gif"></td><td background="/images/left/s-bg.gif" class=button noWrap>&nbsp;<a href="javascript:checkform2();">提 交</a>&nbsp;</td>
                  <td><img border=0 
                        src="/images/left/s-r.gif"></td>
                  <td width="20"></td>
            <td><img border=0 
                  src="/images/left/s-l.gif"></td>
            <td background="/images/left/s-bg.gif" 
                class=button noWrap>&nbsp;<a href="content2.asp?type=<%=itemrs("number")%>">返 回</a>&nbsp;</td>
            <td><img border=0 
                  src="/images/left/s-r.gif"></td></tr>
        </table>
                                                    </td>
                                                  </tr>
                                                </table>
                                              </td>
                                            </tr>
                                          </table>
                                        </td>
                                        <td class="bg_right" width="6"><img src="/images/left/l-r.gif" border=0></td>
                                      </tr>
                                    </table>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr valign="top" class="xxtz_bg"> 
                                        <td width="6"><img src="/images/middle/m_left.gif" width="13" height="8"></td>
                                        <td width="100%" align="right"></td>
                                        <td align="right" width="6"><img src="/images/middle/m_right.gif" width="12" height="8"></td>
                                      </tr>
                                    </table>
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr> 
                      <td height="13">&nbsp;</td>
                    </tr>
                    <tr> 
                      <td><!--#include file="../../include/dot.inc"--></td>
                    </tr>
                    <tr> 
                      <td>&nbsp;</td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
     <SCRIPT language=javascript>
<!--
function checkform()
{  	var Checkblank = /^(\s*|(\ )|(\.))*$/;
	if (Checkblank.test(form.username.value))	 	 
{
          alert("用户名不能为空!");
	  return false;	
         } 
	if (Checkblank.test(form.userpass.value))	 	 
{
          alert("密码不能为空!");
	  return false;	
         } 

      window.form.submit();

   }
   function checkform2()
{     	var Checkblank = /^(\s*|(\ )|(\.))*$/; 
   if (Checkblank.test(dataform.title.value)){
   	alert("标题不能为空!");
   	return ;
   }
             if(dataform.title.value.length>=100)
 {
          alert("标题的字数不能超过100!");
	  return false;	
         }   
      window.dataform.submit();

   }
//-->
</SCRIPT>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -