%
dim url
dim urlname
dim search
dim note
dim sql
dim rs
dim cansave
dim founderr
dim errmsg
dim username
dim mail
founerr=false
if trim(request.form("txturl"))="" then
founderr=true
errmsg="
網站位址不能沒填"
end if
if trim(request.form("txturlname"))="" then
founderr=true
errmsg=errmsg+"網站名稱不能沒填"
end if
if founderr=false then
url=request.form("txturl")
urlname=htmlencode2(request.form("txturlname"))
search=htmlencode2(request.form("search"))
note=htmlencode2(request.form("txtnote"))
username=htmlencode2(request.form("username"))
mail=htmlencode2(request.form("mail"))
set rs=server.createobject("adodb.recordset")
sql="select * from search where (id is null)"
rs.open sql,conn,1,3
rs.addnew
rs("url")=url
rs("urlname")=urlname
rs("search")=search
rs("note")=note
rs("username")=username
rs("mail")=mail
rs("dateandtime")=date()
rs.update
rs.close
set rs=noting
conn.close
set conn=nothing
else
response.write "由於以下的原因不能登錄資料:"
response.write errmsg
end if
response.redirect"default.asp"
%>