用文本+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


标签:新闻,系统,文本,asp
0
投稿

猜你喜欢

  • python中关于数据类型的学习笔记

    2023-10-30 09:31:29
  • Vue新一代状态管理工具Pinia的具体使用

    2024-05-09 15:11:53
  • Pycharm无法打开双击没反应的问题及解决方案

    2021-09-06 07:34:30
  • matplotlib.pyplot.matshow 矩阵可视化实例

    2022-01-04 02:57:21
  • python使用pyaudio录音和格式转化方式

    2023-11-07 19:30:03
  • python3.0 模拟用户登录,三次错误锁定的实例

    2022-07-23 01:35:48
  • python中利用队列asyncio.Queue进行通讯详解

    2023-02-13 03:52:58
  • mysql服务启动却连接不上的解决方法

    2024-01-24 23:45:13
  • python中pylint使用方法(pylint代码检查)

    2023-10-28 09:41:52
  • py中的目录与文件判别代码

    2023-06-01 03:32:06
  • Python创建xml文件示例

    2023-03-08 22:41:45
  • js特殊字符过滤的示例代码

    2023-09-07 21:53:30
  • 泛泛而谈界面视觉效果的一致性

    2010-01-05 17:05:00
  • Python使用sorted对字典的key或value排序

    2023-12-12 06:36:53
  • vue路由嵌套的SPA实现步骤

    2024-04-28 09:20:04
  • numpy中的掩码数组的使用

    2022-10-19 23:36:46
  • Mootools 1.2教程(23)——滑动效果(Slide)

    2009-03-04 12:33:00
  • js实现图片加载淡入淡出效果

    2024-04-22 22:41:15
  • 微信小程序如何使用云开发

    2024-04-10 13:54:27
  • asp如何在网站上提供音乐下载?

    2010-06-22 21:14:00
  • asp之家 网络编程 m.aspxhome.com