To give this option to your members, open your MyData database and create a table called tblUsers with these fields:
ID - autonumber
Usernames - text field
Passwords - text field
DateLastUpdated - date/time field
Next, create a form page called update.asp and copy the below code into your page:
<% DIM mySQL, objRS mySQL = "SELECT Username FROM tblUsers" Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open mySQL, objConn %>
To change your password, enter your Username below:
<% END IF objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing %>
<% ELSE Response.Write "Please click back on your browser and enter your username." END IF %>
Last, create a page called confirm.asp and copy the below code into your page:
<% DIM mySQL, objRS mySQL = "SELECT * FROM tblUsers WHERE fUsername = '" & strUsername & "'" Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open mySQL, objConn, adOpenKeyset, adLockPessimistic, adCmdText objRS.MoveFirst objRS("Password") = Request.Form("Password") objRS("DateLastUpdated") = Date() objRS.Update objRS.Close Set objRS = Nothing Response.Write "
" & strUsername & ",
"
Response.Write " Your password has been succesffully updated in our database.
"
objRS.Close
Set objRS = Nothing
objCONN.Close
Set objCONN = Nothing
%>
That's how you update a record, enjoy.
http://www.aspwebpro.com/aspscripts/records/update.asp
"
Response.Write " Your password has been succesffully updated in our database.
"
objRS.Close
Set objRS = Nothing
objCONN.Close
Set objCONN = Nothing
%>
That's how you update a record, enjoy.
http://www.aspwebpro.com/aspscripts/records/update.asp
No comments:
Post a Comment