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

📄 edit.asp

📁 简单的servlet/jsp注册
💻 ASP
字号:
<%
if session("admin_name")="" then
    response.redirect "index.asp"
end if
%>
<!--#include file="../inc/adconn.asp"-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK rel="stylesheet" type="text/css" href="../style.css"
</HEAD>
<script LANGUAGE="JavaScript">
function check()
{
 if (document.form1.title.value=="")
  {
   alert("请输入新闻标题!")
   document.form1.title.focus()
   document.form1.title.select()
   return
  }
   document.form1.submit()
}
</script>
<%
set rs=server.createobject("adodb.recordset")
Sql="select * from news where newsid="&request("newsid")&"" 
rs.open sql,conn,1,1
%>
<SCRIPT language=javascript>
  var upfile_obj;
  function OnUpFile()
  {
   upfile_obj.src=upfile_obj.lowsrc;
   upfile_obj.src=document.forms["form1"].upfile.value;
  }
</SCRIPT>
<FORM method="post" Action="SaveEdit.asp" Name="form1">
<input type="hidden" name="newsid" value="<%=request("newsid")%>">
<INPUT name=upfile onchange=return(OnUpFile()) type=hidden>
<CENTER>
  <TABLE width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#336699">
    <TR> 
      <TD height=30 colspan=2 background="../images/pics/tile_sub.gif"><b><font color="#FFFFFF">添加新闻</font></b></TD>
  </TR>
    <TR bgcolor="#FFFFFF"> 
      <TD width="17%">新闻标题:</TD>
      <TD width="60%"> 
        <input type="text" name="title" size="52" value="<%=rs("title")%>"><font color=#ff6600> *</font></TD>
  </TR>
    <TR bgcolor="#FFFFFF"> 
      <TD>新闻分类:</td>
      <TD> 
        <select name="typeid">
    <%
      set rstype=server.createobject("adodb.recordset")
      sqltype="select * from newstype"
      rstype.open sqltype,conn,1,1
      do while not rstype.eof
      if rs("typeid")=rstype("typeid") then
         sel="selected"
      else
         sel=""
      end if
      response.write "<option " & sel & " value='"+CStr(rstype("typeID"))+"' name=typeid>"+rstype("type")+"</option>"+chr(13)+chr(10)
      rstype.movenext
      loop
      rstype.close
    %> 
    </select>
    </TD>
  </TR>
    <TR bgcolor="#FFFFFF"> 
      <TD>推荐新闻:</td>
      <TD> 
        <INPUT <%if rs("tjnews")=1 then response.write "checked"%> name=tj type=radio value="1">推荐&nbsp;&nbsp;<INPUT <%if rs("tjnews")=0 then response.write "checked"%> name=tj type=radio value="0">不推荐</TD>
  </TR>
    <TR bgcolor="#FFFFFF"> 
      <TD>新闻内容:</TD>
      <TD><input type="hidden" name="content" value="<%=rs("content")%>"><IFRAME ID="eWebEditor1" SRC="../eWebEditor/ewebeditor.asp?id=content&style=standard_coolblue" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="350"></IFRAME><font color=#ff6600> *</font></TD>
  </TR>
    <TR bgcolor="#FFFFFF"> 
      <TD>来源:</TD>
      <TD> 
        <input type="text" name="nfrom" size="30" value="<%=rs("nfrom")%>"></TD>
  </TR>
    <TR bgcolor="#FFFFFF"> 
      <TD>是否包含图片:</td>
      <TD> 
        <INPUT <%if rs("ispic")=1 then response.write "checked"%> name=ispic type=radio value="1">包含&nbsp;&nbsp;<INPUT <%if rs("ispic")=0 then response.write "checked"%> name=ispic type=radio value="0">不包含</TD>
  </TR>
    <TR bgcolor="#FFFFFF"> 
      <TD> 上传文件: </TD>
      <TD> 
        <iframe name="ad" frameborder=0 width=100% height=30 scrolling=no src=upload.asp></iframe></TD>
  </TR>
    <TR height="30" > 
      <TD colspan="2" align="center" background="../images/pics/tile_sub.gif"> 
        <input type="button" value=" 提 交" onclick="check()">
    <input type="button" name="Submit2" value=" 重 执">
  </TR>
</TABLE>
</form>
</body>
</html>
<% 
 rs.close 
 set rs=nothing 
 conn.close  
 set conn=nothing  
%>

⌨️ 快捷键说明

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