www.gusucode.com > 星云DJ舞曲 4.5a源码程序 > admin/admin_editnews.asp

    <!--#include file="const.asp"-->
<%CheckAdmin1%>
<%
select case request("action")
	   case ""
	   call main()
	   case "edit"
	   call edit()
end select
sub main()
set rsedit=server.CreateObject("adodb.recordset")
sqledit="select * from news where id="&request("id")
rsedit.open sqledit,conn,1,1
%>
<script language="javascript">
function Check()
{
	if (document.add.title.value=="")
	{
	alert("[系统提示]\n\n新闻标题不可为空!");
	document.add.title.focus();
	return false;
	}
	if (document.add.time.value=="")
	{
	alert("[系统提示]\n\n发布时间不可为空!");
	document.add.time.focus();
	return false;
	}
	if (document.add.write.value=="")
	{
	alert("[系统提示]\n\n发布人不可为空!");
	document.add.write.focus();
	return false;
	}
	if (document.add.content.value=="")
	{
	alert("[系统提示]\n\n详细内容不可为空!");
	document.add.content.focus();
	return false;
	}
}
</script>
<LINK href="admin_style.css" type=text/css rel=stylesheet>
<META http-equiv=Content-Type content=text/html; charset=gb2312>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
  <tr>
    <td width="100%" height="25" align="left" valign="middle" class="topbg">  <a href="admin_addnews.asp"><font color="#FFFFFF">发布最新新闻</font></a> | <a href="admin_news.asp"><font color="#FFFFFF">管理新闻</font></a></td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="tdbg">
  <tr>
    <td align="center" valign="top"><table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
        <table width="95%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><form action="?action=edit" method="post" name="add" id="add" onSubmit="return Check()">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="20%" height="25" align="center">新闻标题:</td>
                <td height="25"><input name="title" type="text" id="title" value="<%=rsedit("title")%>" size="50"></td>
              </tr>
              <tr>
                <td width="20%" height="25" align="center">发布时间:</td>
                <td height="25"><input name="time" type="text" id="time" value="<%=rsedit("time")%>" size="20"></td>
              </tr>
              <tr>
                <td width="20%" height="25" align="center">发 布 人:</td>
                <td height="25"><input name="write" type="text" id="write" value="<%=rsedit("write")%>"></td>
              </tr>
              <tr>
                <td width="20%" height="25" align="center">详细内容:</td>
                <td height="25"><textarea name="content" cols="50" rows="5" class="input" id="content"><%=rsedit("content")%></textarea></td>
              </tr>
              <tr>
                <td width="20%" height="25" align="center">&nbsp;</td>
                <td height="25"><input type="submit" name="Submit" value=" 发 布 ">
                   
                  <input type="button" name="Submit2" value=" 返 回 " onClick="history.back()">
                  <input name="id" type="hidden" id="id" value="<%=rsedit("id")%>"></td>
              </tr>
            </table>
                    </form>
          </td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
<%
end sub
sub edit()
set rd=server.createobject("adodb.recordset")
sql="select * from news where id="&request("id")
rd.open sql,conn,1,3
rd("title")=request("title")
rd("time")=request("time")
rd("write")=request("write")
rd("content")=request("content")
rd.update
%>
<script language="javascript">
alert("[系统提示]\n\n新闻修改成功!");
location.href="admin_news.asp";
</script>
<%
rd.close
set rd=nothing
end sub
%>