相关代码: sub king_edtlist() king.head king.path,kc.lang("title")
dim re:re=request.servervariables("http_referer") if len(form("re"))>0 then re=form("re"):if len(re)=0 then re="index.asp?action=edtlist"
dim rs,data,dataform,sql,i,listid,checkpath sql="listname,listpath,listkeyword,listdescription,listtitle"'9 listid=quest("listid",2) if len(listid)=0 then:listid=form("listid") if len(listid)>0 then'若有值的情况下 if validate(listid,2)=false then king.error king.lang("error/invalid") end if
if king.ismethod or len(listid)=0 then dataform=split(sql,",") redim data(ubound(dataform),0) for i=0 to ubound(dataform) data(i,0)=form(dataform(i)) next if len(quest("listid1",2))>0 then data(6,0)=quest("listid1",2) end if else set rs=conn.execute("select "&sql&" from king__link_list where listid="&listid&";") if not rs.eof and not rs.bof then data=rs.getrows() else king.error king.lang("error/invalid") end if rs.close set rs=nothing end if
kc.list
Il "<form name=""form1"" method=""post"" action=""index.asp?action=edtlist"">"
'Il "<p><label>"&kc.lang("label/suplist")&"</label>"&king__list(0,0,data(2,0),listid)&"</p>"
king.form_input "listname",kc.lang("list/listname"),data(0,0),"listname|6|"&encode(kc.lang("check/listname"))&"|1-30" king.form_input "listtitle",kc.lang("label/listtitle"),data(4,0),"listtitle|6|"&encode(kc.lang("check/listtitle"))&"|1-100"
if len(listid)>0 then'更新 checkpath="listpath|6|"&encode(kc.lang("check/path"))&"|1-100;listpath|15|"&encode(kc.lang("check/path1"))&";listpath|9|"&encode(kc.lang("check/path2"))&"|select count(listid) from king__link_list where listpath='$pro$' and listid<>"&listid else checkpath="listpath|6|"&encode(kc.lang("check/path"))&"|1-100;listpath|15|"&encode(kc.lang("check/path1"))&";listpath|9|"&encode(kc.lang("check/path2"))&"|select count(listid) from king__link_list where listpath='$pro$'" end if king.form_input "listpath",kc.lang("label/path"),data(1,0),checkpath king.form_input "listkeyword",kc.lang("label/listkeyword"),data(2,0),"listkeyword|6|"&encode(kc.lang("check/keyword"))&"|0-120" king.form_area "listdescription",kc.lang("label/listdescription"),data(3,0),"listdescription|6|"&encode(kc.lang("check/description"))&"|0-250"
king.form_but "save" king.form_hidden "listid",listid king.form_hidden "re",re
Il "</form>"
if king.ischeck and king.ismethod then if len(listid)>0 then conn.execute "update king__link_list set listname='"&safe(data(0,0))&"',listpath='"&safe(data(1,0))&"',listkeyword='"&safe(data(2,0))&"',listdescription='"&safe(data(3,0))&"',listtitle='"&safe(data(4,0))&"' where listid="&listid&";" else conn.execute "insert into king__link_list ("&sql&",listorder) values ('"&safe(data(0,0))&"','"&safe(data(1,0))&"','"&safe(data(2,0))&"','"&safe(data(3,0))&"','"&safe(data(4,0))&"',"&king.neworder("king__link_list","listorder")&")" end if Il "<script>confirm('"&htm2js(kc.lang("alert/saveok"))&"')?eval(""parent.location='index.asp?action=edtlist'""):eval(""parent.location='"&re&"'"");</script>" end if end sub |