用文本+ASP打造新闻发布系统(2)
发布时间:2009-02-02 09:31:00
//新闻添加
<!--#include file="news_session.asp"-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
.buttonface {
BACKGROUND-COLOR: #0079F2; BORDER-BOTTOM: #333333 1px outset; BORDER-LEFT: #333333 1px outset; BORDER-RIGHT: #ffffff 1px outset; BORDER-TOP: #ffffff 1px outset; COLOR: #ffffff; FONT-SIZE: 9pta { color: #000000; text-decoration: none}
</style>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function client_onblur(ii) {
server=eval("form1.server"+ii)
if(server.value==""){
client=eval("form1.client"+ii)
clientvalue=client.value+""
varlen=clientvalue.length
a=clientvalue.lastIndexOf('\\')
clientvalue=clientvalue.substring(a+1)
//alert(clientvalue);
server.value=clientvalue
}
}
function form1_onsubmit() {
for(i=1;i<1;i++){
client=eval("form1.client"+i)
server=eval("form1.server"+i)
if(client.value!="" && server.value==""){alert("上传后的文件名不能空!");server.focus();return false}
}
}
//-->
</SCRIPT>
<title>新闻发布系统</title>
</head>
<body bgcolor=#EDF0F5 topmargin=10 marginheight=5 leftmargin=4 marginwidth=0>
<form method="POST" action="news_input.asp" name="form1" enctype="multipart/form-data" LANGUAGE=javascript onsubmit="return form1_onsubmit()">
<div align="left">
<table border="1" width="754" height="404">
<tr align="center">
<td width="754" height="28" colspan="3" style="font-size:11pt"><strong>新闻发布系统后台管理--新闻添加</strong></td>
</tr>
<tr>
<td width="121" height="16" align="center" style="font-size:9pt">新闻标题</td>
<td width="617" height="16" colspan="2">
<input type="text" name="news_title" size="87"></td>
</tr>
<tr>
<td width="121" height="165" align="center" style="font-size:9pt">新闻内容</td>
<td width="617" height="165" colspan="2"><textarea rows="11" name="news_content" cols="85"></textarea></td>
</tr>
<tr>
<td width="121" height="21" align="center" style="font-size:9pt">新闻来源</td>
<td width="617" height="21" colspan="2">
<input type="text" name="news_src" size="87"></td>
</tr>
<tr>
<td width="121" height="20" align="center" style="font-size:9pt" >图片上传</td>
<td width="617" height="20" colspan="2">
<input type="file" name="client1" size="20" readonly LANGUAGE=javascript onblur="return client_onblur(1)" >
<span style="font-size:9pt"></span> <INPUT type="hidden" name="server1"> <input type="hidden" value="mysession" name="mysession"> </td>
</tr>
</table>
</div>
<p>
<input type="submit" value="递交" name="B1" class="buttonface"> <input type="reset" value="全部重写" name="B2" class="buttonface">
<input type="button" value="帐号修改" onclick="location.href='admin/news_chadmin.asp'" name="B2" style="font-size:10pt;color:#000000;" class="buttonface">
<input type="button" value="新闻修改" onclick="location.href='news_admin1.asp'" name="B2" style="font-size:10pt;color:#000000;" class="buttonface"></p>
</form>
</body>
</html>
'###################
news_input.asp
<!--#include file="upload.inc"-->
<%
'Fields("xxx").Name 取得Form中xxx(Form Object)的名字
'Fields("xxx").FilePath 如果是file Object 取得文件的完整路径
'Fields("xxx").FileName 如果是file Object 取得文件名
'Fields("xxx").ContentType 如果是file Object 取得文件的类型
'Fields("xxx").Length 取得Form中xxx(Form Object)的数据长度
'Fields("xxx").Value 取得Form中xxx(Form Object)的数据内容
Dim FormData,FormSize,gnote,bnote,notes,binlen,binstr
FormSize=Request.TotalBytes
FormData=Request.BinaryRead(FormSize)
Set Fields = GetUpload(FormData)
'############判断输入错误
dim news_title,news_content,news_src,mysession
mysession=Fields("mysession").value
if len(mysession)=0 then
Response.Write "非法登陆或超时请重新登陆"
Response.End
end if


猜你喜欢
- 本文实例为大家分享了wxPython色环电阻计算器的具体代码,供大家参考,具体内容如下import wx # 导入wxPythonclass
- 前言:Python内置对SMTP的支持,可以发送纯文本邮件、HTML邮件以及带附件的邮件。Python对SMTP支持有smtplib和ema
- python的图形用户界面我是大帅哥啊 python的图形用户界面msgbox的使用ccbox的使用buttonbox的使用buttonbo
- 任务识别用相机拍下来的答题卡,并判断最终得分(假设正确答案是B, E, A, D, B)主要步骤轮廓识别——答题卡边缘识别透视变换——提取答
- 修改python plot折线图的坐标轴刻度,这里修改为整数:代码如下:from matplotlib import pyplot as p
- Anaconda安装:anaconda官方下载地址https://www.anaconda.com/products/individual注
- API照例,我们搬一下官网的 API:C++void cv::filter2D(InputArray src,
- 今天在测试以下代码时遇到该错误:session_start();$_SESSION['username']=$usernam
- MySQL 系统会在内存(MEMORY)和磁盘(MyISAM)中建立临时表,如何能知道在磁盘中建立了多少临时表以及在内存中建立多
- 因为前端课要交一个大作业,刚好工作室的项目需要一个后台管理界面,就自学了一下vue,今天做了一个选项卡切换,最开始的作为菜鸡是用的js做的,
- 你不得不承认,今天网络发展之迅速,信息流动速度之快、量之大,是我们不曾考虑过的,但现在它就真真切切地摆在我们面前。如何接纳信息,怎么处理、消
- 是在CSDN论坛看到的一个问题,平常我也没有注意,或者说没有这样用吧。看代码 <body id="ww
- 有的时候,一个 if … else … 还不够用。比如,根据年龄的划分:条件1:18岁或以上:adult条件2:6岁或以上:teenager
- PHP number_format() 函数实例格式化数字:<?php echo number_format("100000
- 除了在Matlab中使用PRTools工具箱中的svm算法,Python中一样可以使用支持向量机做分类。因为Python中的sklearn库
- 1. defer的简单介绍与使用场景defer是Go里面的一个关键字,用在方法或函数前面,作为方法或函数的延迟调用。它主要用于以下两个场景:
- <form name="form5" id="form5" me
- 1. EXISTS的执行流程 select * from t1 where exists ( select null from t2 whe
- 【一:下载·安装】1.下载node.js下载地址:Node.js 或者 点击这里下载2.安装2.1选择No
- Access允许您在数据库表中包含附件。通过利用微软的对象链接和嵌入(OLE)技术,您可以将照片、图表、文档及其他文件存储在您的Access