<!--#include file="CONN.ASP"-->
<!--#include file=cookies.asp-->
<%
function chkijob(char) 
if instr(char,"'") then 
response.write "错误字符！"
response.end 
end if
if instr(char,"|") then
response.write "错误字符！"
response.end 
end if
if instr(char,"<") then
response.write "错误字符！"
response.end 
end if
if instr(char,">") then
response.write "错误字符！"
response.end 
end if
if instr(char,"&") then
response.write "错误字符！"
response.end 
end if
if instr(char,"%") then
response.write "错误字符！"
response.end 
end if
if instr(char,";") then
response.write "错误字符！"
response.end 
end if
if instr(char,"$") then
response.write "错误字符！"
response.end 
end if
end function
function IsValidEmail(email)
dim names, name,i,c
IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
   IsValidEmail = false
   exit function
end if
for each name in names
   if Len(name) <= 0 then
     IsValidEmail = false
     exit function
   end if
   for i = 1 to Len(name)
     c = Lcase(Mid(name, i, 1))
     if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
       IsValidEmail = false
       exit function
     end if
   next
   if Left(name, 1) = "." or Right(name, 1) = "." then
      IsValidEmail = false
      exit function
   end if
next
if InStr(names(1), ".") <= 0 then
   IsValidEmail = false
   exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
   IsValidEmail = false
   exit function
end if
if InStr(email, "..") > 0 then
   IsValidEmail = false
end if
end function
dim rs,sql,class1,class2,company,memo,comname,xinxipic,userip,id
id=trim(request("id"))
comname=trim(request("comname"))
class1=trim(request("class1"))
class2=trim(request("class2"))
company=trim(request("company"))
memo=trim(request("memo"))
xinxipic=trim(request("xinxipic"))
if class1="0" or class1="" then
response.write "分类错误！"
response.end
end if
if class2="0" or class2="" then
response.write "分类错误！"
response.end
end if
if company="" then
response.write "标题为空！"
response.end
end if
chkijob(company)
if len(company)>40 then
response.write "标题过长！"
response.end
end if
if memo="" then
response.write "内容为空！"
response.end
end if
id=trim(request("id"))
	set rs=server.createobject("adodb.recordset")
	sql="select * from [FOX_zixun] where id="&cstr(id)
	rs.open sql,conn,1,3
if rs.eof then
errijob(0)
response.end
end if
rs("class1")=class1
rs("class2")=class2
rs("company")=company
rs("memo")=memo
rs("xinxipic")=xinxipic
rs("comname")=trim(request("comname"))
rs("fbsj")=now()
rs.update
rs.close
set rs=nothing
closedb
response.write "<p align=""center"">修改<font color=ff0000>"&company&"</font>成功！</p>"
response.write "<script language=JavaScript>" & chr(13) & "alert('修改成功！');" & "window.location='zixun.asp'" & "</script>"
%></body></html>