oasisp
Posts: 48
|
| Posted: 09/01/2010, 1:33 PM |
|
Retrieve Password Script Not working even i have email address on database table it says
The logon_email address is not registered. it doesnt sent email. i appreciate your help
i found the scripts here http://forums.yessoftware.com/posts.php?post_id=56410 http://forums.yessoftware.com/posts.php?post_id=44660
below is my customized scripts
<?php
//BindEvents Method @1-E50B4F0C
function BindEvents()
{
global $USERACCESS2;
$USERACCESS2->logon_email->CCSEvents["OnValidate"] = "USERACCESS2_logon_email_OnValidate";
}
//End BindEvents Method
//USERACCESS2_logon_email_OnValidate @4-3BF11F8F
function USERACCESS2_logon_email_OnValidate()
{
$USERACCESS2_logon_email_OnValidate = true;
//End USERACCESS2_logon_email_OnValidate
//Custom Code @5-2A29BDB7
// -------------------------
// Write your own code here.
// -------------------------
//End Custom Code
// -------------------------
global $USERACCESS2;
// Write your own code here.
// -------------------------
$db = new clsDBconn();
$MainPage->Connections["conn"] = & $db;
$to = $USERACCESS2->logon_email->GetText();
$db->query("SELECT * FROM USERACCESS2 WHERE Logon_Email=$to");
//$db->query("SELECT * FROM USERACCESS2 WHERE Logon_Email=\"".$request->logon_email->Value."\"");
$db->next_record();
// members is the name of the table that holds the logon_email address
if($db->f("Logon_Email") == ""){
//header("Location: validate.php")
//die()
$USERACCESS2->Errors->AddError("\n"."The logon_email address is not registered");
// logon_email was not found in the data base --> return Error to the user
}else{
$to = $USERACCESS2->logon_email->GetText();
$User_Name=CCDLookUp("logon_name", "USERACCESS2","Logon_Email= ".CCToSql($to,ccsText),$db);
$userpass=CCDLookUp("logon_password", "USERACCESS2", "Logon_Email= ".CCToSql($to,ccsText),$db);
$subject = "Your Lance Dealer Login Details";
$message = "Your login details for Lance Camper Dealer Website."."\n"."\n"."Your login name: " .$User_Name ."\n"."\n"."Your password: " .$userpass . "\n" ."\n";
$from = "webmaster@lancecamper.com";
$additional_headers = "From: $from\nReply-To: $from\nContent-Type: text/plain";
mail ($to, $subject, $message, $additional_headers);
CCSetSession("confirm_mess", "Your email has been dispatched");
}
//End Send logon_email
//End Custom Code
//Close USERACCESS2_logon_email_OnValidate @4-ECD67DD7
return $USERACCESS2_logon_email_OnValidate;
}
//End Close USERACCESS2_logon_email_OnValidate
?>
|
 |
 |
|