<% Option Explicit %>
<%
if request.form("biaoti") <> "" and request.form("text") <> "" then
dim db
set db=Server.CreateObject("ADODB.Connection")
db.Open "link_new"
Dim strSql,sqla,sqlb, var_headline, var_text, var_time
var_headline=request.form("biaoti")
var_text=request.form("text")
var_time=request.form("time")
sqla="Insert Into news(headline,text"
sqlb=" values('" & var_headline & "','" & var_text &"' ,'" & var_time &"'"
if var_time<>"" then
sqla=sqla & ",time"
sqlb=sqlb & ",'" & var_time & "'"
end if
strSql=sqla & ")" & sqlb & ")"
db.Execute(strSql)
response.redirect "index_edit.htm"
else
response.write "请将所有信息填写完整,"
response.write "<a href='add_form.asp'>重新添加</a>"
end if
%>