<% Name1 = request.form("Name1") Name2 = request.form("Name2") password1 = request.form("Password1") password2 = request.form("Password2") password3 = request.form("Password3") action = request.querystring("action") '============================================== '======= including the HeaderTableStart '============================================== HeaderTableTitle = "Admin Info: Edit" %> <% ''''' HeaderTableEnd : must be added after including the HeaderTableStart '============================================== If action = "change" then '''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''' In executing query: if there is Error Resume Next '''''''''''''''''''''''''''''''''''''''''''''''''''''''' On Error Resume Next SelectSQL = "SELECT * FROM admin WHERE id=1" Set rs = ADO.execute(SelectSQL) If Name1 = "" OR Name2 = "" OR password1 = "" OR password2 = "" OR password3 = "" then writeMSG "Please fill the blank fields.", "ErrorType" Elseif rs("name") <> name1 then writeMSG "The current username is incorrect.", "ErrorType" Elseif rs("pass") <> password1 then writeMSG "The current password is incorrect.", "ErrorType" Elseif password2 <> password3 then writeMSG "The two passwords does not match.", "ErrorType" else '''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''' In executing query: if there is Error Resume Next '''''''''''''''''''''''''''''''''''''''''''''''''''''''' On Error Resume Next updateSQL= "UPDATE admin SET name = '"&Name2&"', pass='"&password2&"' WHERE id=1" ADO.execute(updateSQL) if err.number = 0 then writeMSG "Updating done successufly." , "OkType" else writeMSG "Error : "& err.description & " from " & err.source &".", "ErrorType" end if ' Don't show the text fields status = "exit" End If End if If status <> "exit" then %>
Current username
Current password
   
New username
New password
Reenter new password

<% end if ADO.close Set ADO=Nothing Response.write HeaderTableEnd %>