<%@ Language=VBScript %>
<!--#include file="../conn.asp"-->
<!--#include file="../incs/FreeHostFunctionMain.asp"-->
<!--#include file="../incs/FreeHostFunction.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request.Form ("title")="" Then
	ef=True
	ec="标题没填！"
ElseIf Request.Form ("body")="" Then
	ef=True
	ec="内容没填！"
ElseIf Request("id")<>"" and not IsNumeric(Request("id")) Then
	ef=True
	ec="编号必须是数字"
ElseIf Request.Form ("ismod")="y" and request.Form ("id")="" Then
	ef=True
	ec="编号ID没填！"
end if
if not ef then

	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from wwwi_News where username='freehost' and id="&Request("id")&""
		 if request("id")=""   then	Sql="Select * from wwwi_News where username='freehost' and id=999999999"
		ds.Open Sql,conn,1,3
if Request.Form ("ismod")="y" and ds.Eof then
	ef=True
	ec="没找到要修改的ID！"
end if

if not ef then

if Request.Form ("ismod")<>"y" then ds.AddNew

scon=Request.Form ("body")

''response.write Request.Form ("body")
''response.end

ds("username")="freehost"
ds("title")=request.Form ("title")
ds("con")=scon
ds("posttime")=NOW
if  IsNumeric(Request.Form("orderbyid")) then
ds("orderbyid")=Request.Form("orderbyid")
else
ds("orderbyid")=0
end if

if  IsNumeric(Request.Form("typeid")) then
ds("typeid")=Request.Form("typeid")
else
ds("typeid")=0
end If

if  IsNumeric(Request.Form("type1")) then
ds("type1")=Request.Form("type1")
else
ds("type1")=0
end If

If ds("type1")>0 then
if  IsNumeric(Request.Form("type2")) then
ds("type2")=Request.Form("type2")
else
ds("type2")=0
end If
End if

ds.Update
ds.Close
set ds=nothing
conn.Close 
set conn=nothing
Response.Redirect "news.asp"
end if

end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
