% if request.Cookies("MYWINCH")("cn")="" then %> <% else table="au" if request.form("addedit_subed")="true" then '表单提交后 editid=request.Cookies("MYWINCH")("cid") autype=Request.Form("autype") auname=Request.Form("auname") aupws=Request.Form("aupws") aultd=Request.Form("aultd") ausex=Request.Form("ausex") auage=Request.Form("auage") autel=Request.Form("autel") auaddress=Request.Form("auaddress") autime=Request.Form("autime") aucheck=Request.Form("aucheck") '服务器端验证 'outcheck(CheckValue(autype,,,1,"autype")) 'outcheck(CheckValue(auname,,,1,"auname")) 'outcheck(CheckValue(aupws,,,1,"aupws")) 'outcheck(CheckValue(aultd,,,1,"aultd")) 'outcheck(CheckValue(ausex,,,1,"ausex")) 'outcheck(CheckValue(auage,,,1,"auage")) 'outcheck(CheckValue(autel,,,1,"autel")) 'outcheck(CheckValue(auaddress,,,1,"auaddress")) 'outcheck(CheckValue(autime,,,1,"autime")) 'outcheck(CheckValue(aucheck,,,1,"aucheck")) if editid="" then '添加状态 ' 防止二义性信息逻辑**************** 'set rs_test=Server.CreateObject("ADODB.RECORDSET") 'rs_test.Open "select count(*) as counter from " & table & " where username='" & username & "'",conn 'if rs_test("counter")>0 then ' call Msgout("用户名已存在, 不能添加!","javascript:history.back()",3) ' Response.End 'end if '************************************ '添加时使用的字段 field1=array("autype","auname","aupws","aultd","ausex","auage","autel","auaddress","autime","aucheck") value1=array(autype,auname,aupws,aultd,ausex,auage,autel,auaddress,autime,aucheck) for i=0 to ubound(field1) value1(i)=replace(value1(i),"'","''") next sql = "INSERT INTO " & table & " (" & Join(field1, ",") & ") VALUES ('" & Join(value1, "','") & "')" word="你的信息已成功加入!" else '编辑状态 '编辑时使用的字段 field1=array("auname","aupws","aultd","ausex","auage","autel","auaddress") value1=array(auname,aupws,aultd,ausex,auage,autel,auaddress) sql="UPDATE " & table & " SET " for i=0 to ubound(field1) sql = sql & field1(i) & "='" & replace(value1(i),"'","''") & "'" if i <> ubound(field1) then sql=sql & "," else sql=sql & " where id=" & editid end if next word="你的信息已成功修改!" end if conn.Execute sql else '进入页面时(非提交) editid=request.Cookies("MYWINCH")("cid") if editid<>"" then '编辑状态 onload="onload=""page_onload();""" set rs1=Server.CreateObject("ADODB.RECORDSET") rs1.Open "select * from " & table & " where id =" & editid ,conn autype=rs1("autype") auname=rs1("auname") aupws=rs1("aupws") aultd=rs1("aultd") ausex=rs1("ausex") auage=rs1("auage") autel=rs1("autel") auaddress=rs1("auaddress") autime=rs1("autime") aucheck=rs1("aucheck") else '添加状态 autype="" auname="" aupws="" end if end if %>
<% if request.form("addedit_subed")="true" then %>
|