<% if request("editid")<>"" then %> <% end if %> <% table="OB" if request.form("addedit_subed")="true" then '表单提交后 editid=request.form("editid") ob01=Request.Form("ob01") ob02=Request.Form("ob02") ob03=Request.Form("ob03") ob04=Request.Form("ob04") ob05=Request.Form("ob05") ob06=Request.Form("ob06") OC01=Request.Form("OC01") OC02=Request.Form("OC02") OC03=Request.Form("OC03") OC04=Request.Form("OC04") OC05=Request.Form("OC05") OC06=Request.Form("OC06") '服务器端验证 'outcheck(CheckValue(ob01,,,1,"ob01")) 'outcheck(CheckValue(ob02,,,1,"ob02")) 'outcheck(CheckValue(ob03,,,1,"ob03")) 'outcheck(CheckValue(ob04,,,1,"ob04")) 'outcheck(CheckValue(ob05,,,1,"ob05")) 'outcheck(CheckValue(ob06,,,1,"ob06")) 'outcheck(CheckValue(OC01,,,1,"OC01")) 'outcheck(CheckValue(OC02,,,1,"OC02")) 'outcheck(CheckValue(OC03,,,1,"OC03")) 'outcheck(CheckValue(OC04,,,1,"OC04")) 'outcheck(CheckValue(OC05,,,1,"OC05")) 'outcheck(CheckValue(OC06,,,1,"OC06")) 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("ob01","ob02","ob03","ob04","ob05","ob06","OC01","OC02","OC03","OC04","OC05","OC06") value1=array(ob01,ob02,ob03,ob04,ob05,ob06,OC01,OC02,OC03,OC04,OC05,OC06) 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("ob01","ob02","ob03","ob04","ob05","ob06","OC01","OC02","OC03","OC04","OC05","OC06") value1=array(ob01,ob02,ob03,ob04,ob05,ob06,OC01,OC02,OC03,OC04,OC05,OC06) 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("editid") if editid<>"" then '编辑状态 onload="onload=""page_onload();""" set rs1=Server.CreateObject("ADODB.RECORDSET") rs1.Open "select * from " & table & " where id =" & editid ,conn ob01=rs1("ob01") ob02=rs1("ob02") ob03=rs1("ob03") ob04=rs1("ob04") ob05=rs1("ob05") ob06=rs1("ob06") OC01=rs1("OC01") OC02=rs1("OC02") OC03=rs1("OC03") OC04=rs1("OC04") OC05=rs1("OC05") OC06=rs1("OC06") else '添加状态 ob01="" ob02="" ob03="" end if end if %> <% if request.form("addedit_subed")<>"true" then '********************* %> <% end if '************************************************* %> > <% if request.form("addedit_subed")="true" then %>
<% =word %>
<% session("reguser")=OC01 session("postinfo")="orderform" response.redirect "/OOinfo.html" else %>
ob01:
ob02:
ob03:
ob04:
ob05:
ob06:
OC01:
OC02:
OC03:
OC04:
OC05:
OC06:
<% end if %>