mbennie
|
Posted: 01/19/2002, 5:11 PM |
|
Some sample code?
|
|
|
jeremy
|
Posted: 01/19/2002, 9:39 PM |
|
You can download the gotocode site and look at the example code. Here is what I did from that.
Make a "forgot" form on your login page.
In the "before insert" event put in something like this.
'The recordset is created and read in the Validation section
email_subject = "Re: Fogotten yourdomain.com Password"
email_body = "Per your request, we are emailing you your login information." & VBcrlf & _
"Your Username/Login is: " & GetValue(user_rs, "member_login") & VBcrlf & _
"Your Password is: " & GetValue(user_rs, "member_password") & VBcrlf & _
VBcrlf & _
"Thank you for visiting http://www.yourdomain.net"
'Send text email
call sendemail("support@yourdomain.net", GetValue(user_rs, "email"), email_subject, email_body, 1)
Then add this in the "validation" event.
'Try finding this user
openrs user_rs, "SELECT * FROM members WHERE member_login=""" & flduser_entry & """ OR email=""" & flduser_entry & """"
if GetValue(user_rs, "member_id") = "" then sForgotErr = sForgotErr & chr(13) & "Sorry. We could not find this Username or Email address in our records."
You will have to also add the following in the "modules" portion of codecharge.
'Send single Email
sub sendemail(email_from, email_to, email_subject, email_body, email_format)
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = email_from
objCDO.To = email_to
objCDO.Subject = email_subject
objCDO.Body = email_body
objCDO.BodyFormat = email_format
objCDO.MailFormat = email_format
objCDO.Send
set objCDO=Nothing
end sub
Of course you will have to change the field names if your members table is called something else. Have fun.
Jeremy
|
|
|
Nebul4E
|
Posted: 01/19/2002, 11:47 PM |
|
Someone has some code available to achieve this with PHP ?
|
|
|
Nicole
|
Posted: 01/21/2002, 1:46 AM |
|
Hello,
download GotoCode site from: http://www.codecharge.com/download/files/examples/gotocodev2.zip
And refer to Login page/Forgot form. The site includes PHP events also.
|
|
|
|