swartzieee
05-11-2006, 04:57 AM
Here is my code:
<%
DIM strEmail
strEmail = Request.Form("email")
IF strEmail <> "" THEN
%>
<%
DIM sql, rs, Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("/swartzjm/datastore/login.mdb") & ";"
Conn.Open
sql = "SELECT email, password, username FROM login WHERE email = '" & strEmail & "'"
Set rs = Server.CreateObject( "ADODB.Recordset" )
rs.Open sql, Conn
IF rs.EOF THEN
Response.Write "That email address was not found in our database."
Response.Write "<b>Please click Back on your browser and enter the email address you registered with.</b>"
ELSE
DIM strPassword, strUsername
strPassword = rs("password")
strUsername = rs("username")
DIM mail, objMail
Set objMail = Server.CreateObject("CDO.Message")
objMail.From = "Webmaster@CareersandJobs.com"
objMail.Subject = "Forgotten Login Information"
objMail.To = strEmail
objMail.TextBody = "Here is your login information for the email address of " & strEmail & vbCrLf & _
"Username: " & strUsername & vbCrLf & _
"Password: " & strPassword
objMail.Send
Set objMail = nothing
Response.Write "Your password has been sent to your email address." & "<br>"
Response.Write "<br>" & "<b> Please allow up to 24 hours to recieve your login information. </b>"
END IF
ELSE
Response.Write "Please click Back on your browser and enter the email address you registered with."
END IF
Conn.close
Set Conn = nothing
rs.close
Set rs = nothing
%>
<%
DIM strEmail
strEmail = Request.Form("email")
IF strEmail <> "" THEN
%>
<%
DIM sql, rs, Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("/swartzjm/datastore/login.mdb") & ";"
Conn.Open
sql = "SELECT email, password, username FROM login WHERE email = '" & strEmail & "'"
Set rs = Server.CreateObject( "ADODB.Recordset" )
rs.Open sql, Conn
IF rs.EOF THEN
Response.Write "That email address was not found in our database."
Response.Write "<b>Please click Back on your browser and enter the email address you registered with.</b>"
ELSE
DIM strPassword, strUsername
strPassword = rs("password")
strUsername = rs("username")
DIM mail, objMail
Set objMail = Server.CreateObject("CDO.Message")
objMail.From = "Webmaster@CareersandJobs.com"
objMail.Subject = "Forgotten Login Information"
objMail.To = strEmail
objMail.TextBody = "Here is your login information for the email address of " & strEmail & vbCrLf & _
"Username: " & strUsername & vbCrLf & _
"Password: " & strPassword
objMail.Send
Set objMail = nothing
Response.Write "Your password has been sent to your email address." & "<br>"
Response.Write "<br>" & "<b> Please allow up to 24 hours to recieve your login information. </b>"
END IF
ELSE
Response.Write "Please click Back on your browser and enter the email address you registered with."
END IF
Conn.close
Set Conn = nothing
rs.close
Set rs = nothing
%>