View Full Version : Forgotten username/password email reponse
karolmcauley
10-14-2002, 11:41 PM
I have attached to pages :
forgotuname.html and
forgotuname_validate.html
It works ok but unfortunately the data (username/password)doesn't seem to get emailed to the person concerned, even though it defintely exists in the DB, under the appropriate username.
I have also tried to validate my email without much success......can anyone help.......? The attempted validation is remmed out in the attahced pages.
Many thx in advance
whammy
10-15-2002, 12:57 AM
Try this... that is some of my earlier (sloppier) code you're working with, so I tried to clean it up a bit as well... :)
karolmcauley
10-15-2002, 08:51 PM
I have implemented your revised code whammy, but.......
At first it was giving me an error stating that the object "TheConnection" did not exist. Which i didn't really know why. But i moved the code out of the open connection sub to look like this:
'Get Form Variables
useremail = Request.Form("email2")
Set TheConnection = Server.CreateObject("ADODB.Connection")
Call OpenConnection()
TheQueryString = "Select username, pass from table_users where email = '" & useremail & "'"
If ValidEmail(useremail) = True Then
Set objUsers = TheConnection.Execute(TheQueryString)
If NOT objUsers.EOF Then
SendMail()
DisplaySuccess()
Else
DisplayError()
End If
Else
DisplayError()
End If
Call CloseConnection()
But still i receive an email with no username or password attached....the same problem as in the first case. Any ideas? I will have a further look at it now though!
whammy
10-15-2002, 11:22 PM
Yeah, I know exactly why... and I'll fix it for you tonight when I get home. ;)
whammy
10-16-2002, 12:46 AM
Try this... usually that happens because the variables were not dimensioned ("Dim"med). And when you don't Dim them, their values are not passed to subroutines.
That's why using Option Explicit (as in the attached fix, which I think will work, but it errors on me since I tested it on my local machine running PWS on Windows ME and can't run the CDONTS component) is a good practice. :)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.