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

📄 newsadd.asp

📁 很漂亮的一个网络公司的源码
💻 ASP
字号:
<!--#include file="check.asp"-->
<!--#include file=conn.asp-->
<!--#include file=../Function/function.asp-->
<%
Dim sContent1
if IsSubmit And CheckAdmin then
	Dim objRec
	For i = 1 To Request.Form("content").Count 
		sContent1 = sContent1 & Request.Form("content")(i) 
	Next 
	If Len(Trim(sContent1))=0 Then
		Response.Write "<script>" & vbcrlf
		Response.Write "alert('文章内容不能为空');" & vbcrlf
		Response.Write "history.back();" & vbcrlf
		Response.Write "</script>" & vbcrlf
	End If
	Set objRec = server.createobject("adodb.recordset")
	With objRec
		.open "SELECT * FROM News where tid = null",conn,1,3
		.Addnew
		.Fields("p_Title").Value=Request.Form("title")
		If Request.Form("copyfrom")="" then
			.Fields("copyfrom").Value="新创科技"
		Else
			.Fields("copyfrom").Value=Request.Form("copyfrom")
		End if
		.Fields("TypeID").Value = Request.Form("p_type")
		.Fields("p_Content").Value = sContent1
  '删除无用的上传文件
	.Update
	.close
  End With
  Set rs=nothing
	Call connclose()
	Call MessageBoxOK("添加成功!") '完成提示
End if
Private Sub MessageBoxOK(strValue)
'response.write "<script>alert('新闻添加成功!');parent.location.href='index.asp'</script>"
	With Response
		.Write "<script>" & vbcrlf
		.Write "alert('"+strValue+"');" & vbcrlf
		.Write "location.href='" & request.ServerVariables("HTTP_REFERER") & "'" & vbcrlf
		.Write "</script>" & vbcrlf
	End With
End Sub
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>杭州华田水处理设备有限公司
</title>
<link rel="stylesheet" href="../css/style.css" type="text/css">
<script language = "JavaScript">
function CheckForm(frm)
{
  //document.myform.Content.value=eWebEditor1.HtmlEdit.document.body.innerHTML; 
  if (frm.Title.value=="")
  {
    alert("技术资料名称不能为空!");
	frm.Title.focus();
	return false;
  }
  return true;
}
function OutMessage(sValue)
{
	alert(sValue);
}
function loadForm()
{
  editor.HtmlEdit.document.body.innerHTML=document.form.content.value;
  return true
}
</script>
</head>
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
  <form method="POST" name="form" onSubmit="return CheckForm(this);" target="_self" action="">
    <tr>
      <td height="20" align="center" class="title"><b>新 增 技 术 资 料</b></td>
    </tr>
    <tr align="center">
      <td class="tdbg">
	<table width="100%" border="0" cellpadding="2" cellspacing="0">
          <tr> 
            <td width="80" align="right">标题:</td>
            <td colspan="3"><input name="Title" type="text"
           id="Title" size="40" maxlength="100"></td>
          </tr>
          <tr>
            <td align="right">类型:</td>
            <td colspan="3"><select name="p_Type" id="p_Type">
              <option value="1" selected>业内动态</option>
              <option value="2">公司新闻</option>
														<option value="3">最新案例</option>
            </select></td>
          </tr>
          <tr> 
		  <input name="Editor" type="hidden" id="Editor"> 
            <td width="80" align="right">出处:</td>
            <td colspan="3"><input name="CopyFrom" type="text"
           id="CopyFrom" size="25" maxlength="255" Value="新创科技">
		   <input type="hidden" name="ADSrc">
		   </td>
          </tr>
          <tr> 
            <td width="80" align="right" valign="top">内容:</td>
            <td colspan="3">
			<INPUT type="hidden" name="content" value="">
			<IFRAME ID="eWebEditor1" SRC="../editor/ewebeditor.asp?id=content&style=standard_coolblue" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="350"></IFRAME>            </td><input name="UploadFiles" type="hidden" id="UploadFiles">
          </tr>
        </table>

  <div align="center">
  <input name="Add" type="submit"  id="Add" value=" 添 加 ">
  <input name="Add" type="button"  id="Add" value=" 返 回 " onClick="location.href='newsmanage.asp';">
  </div>
</td>
</tr>
</form> 
</table>

⌨️ 快捷键说明

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