<!--#include file="pathcheck.asp"-->
<!--#include file="isy.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<% 
vpwd=Trim(Request.Form("password"))
cman=Trim(Request.Form("username"))
npwd=Trim(Request.Form("n_password"))
anpwd=Trim(Request.Form("a_n_password"))

if vpwd="" or cman="" or npwd="" or anpwd=""  then Response.Redirect("rep.asp?operate=blank")
if npwd<>anpwd then Response.Redirect("rep.asp?operate=nosame")

vpwd=md5(vpwd)
cman=md5(cman)
npwd=md5(npwd)
anpwd=md5(anpwd)

sql="select top 1 * from cvote where vpwd='"&vpwd&"' order by id desc"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof then Response.Redirect("rep.asp?operate=pwdwrong")

rs("cman")=cman
rs("vpwd")=npwd

rs.update
closers
closedb
response.Redirect("rep.asp?operate=editcvote")
%>