% Public Function Checkstr(Str) If Isnull(Str) Then CheckStr = "" Exit Function End If Str = Replace(Str,Chr(0),"") CheckStr = Replace(Str,"'","''") End Function if request("act")&""="dl" then if trim(request("un")&"")<>"" and trim(request("pwd")&"")<>"" then password=md5(trim(CheckStr(request("pwd"))),16) set rs=conn.execute("select userid,userpassword from homee..dv_user where username='"&trim(request("un"))&"'") if rs.eof then session("uid")="" session("un")="" else if rs(1)=password then session("uid")=rs(0) session("un")=trim(request("un")&"") else session("uid")="" session("un")="" end if end if end if end if if request("act")&""="save" then sjt1=trim(request("pic2")&"") sjt2=trim(request("pic3")&"") logo=trim(request("pic4")&"") if sjt1="" then sjt1="nopic.gif" if sjt2="" then sjt2="nopic.gif" if logo="" then logo="nophoto.gif" sql="select * from chanpin" set rs=server.CreateObject("adodb.recordset") rs.open sql,conn,1,3 rs.addnew rs("fl")=cint(trim(request("rd")&"")) rs("mc")=trim(request("mc")&"") rs("pic")=trim(request("pic1")&"") rs("sjt1")=sjt1 rs("sjt2")=sjt2 rs("logo")=logo rs("js")=trim(request("js")&"") rs("ppjs")=trim(request("ppjs")&"") rs("tjly")=trim(request("tjly")&"") rs("upuser")=session("un") rs("upuserid")=session("uid") rs.update response.Redirect("?") end if %>
|