当我提交时会覆盖原内容?这是为什么!?
什么意思?覆盖数据库里原有数据?
你用的是修改记录吧?
<!--#include file="set.asp"-->
<%
if request.Cookies("adminok")=""then
response.Redirect"error.asp"
end if
%>
<%
dim title
dim times
dim texts
title=request.Form("title")
times=request.Form("times")
texts=request.Form("texts")
if title="" then
Response.Write("<script>alert('请输入新闻标题!');history.go(-1)</script>")
Response.End
end if
if texts="" then
Response.Write("<script>alert('请输入新闻内容!');history.go(-1)</script>")
Response.End
end if
ssql="select * from news "
rst.open ssql,cnn,1,3
rst("title")=title
rst("times")=times
rst("texts")=texts
rst.update
rst.close
set rst=nothing
Response.Write("<script>alert('添加成功!');window.location=('admin_news.asp')</script>")
cnn.close
set cnn=nothing
%>