// include header include("inc_header.php"); // initialize parameter variables $p_op = init_param("p_op", ""); $p_email = init_param("p_email", ""); $p_account = init_param("p_account", ""); // check to see if we need to email account information to a user if($p_op == "forgot") { // verify user information if(($p_email != "") && ($p_account != "")) { // construct sql to retrieve the requested records $l_sql = ("SELECT * FROM dealers WHERE ((email = '".$p_email."') && (account = '".$p_account."'))"); // retrieve the requested records $rs_dlr = mysqli_query($g_db_connection, $l_sql); // validate user information if($r_dlr = mysqli_fetch_array($rs_dlr)) { // retrieve the record data $dlr_account = stripslashes($r_dlr["account"]); $dlr_contact = stripslashes($r_dlr["contact"]); $dlr_email = stripslashes($r_dlr["email"]); $dlr_organization = stripslashes($r_dlr["organization"]); $dlr_pass = stripslashes($r_dlr["pass"]); $dlr_pk = stripslashes($r_dlr["pk"]); // initialize email subject $mail_sub = ("C'est Papier Dealer Account Information"); // initialize email message $mail_msg = ("\n"); $mail_msg .= ("
\n"); $mail_msg .= ("Here is the account information you requested from the C'est Papier website on ".date("Y.m.d", time())." at ".date("H:i:s", time()).".\n");
$mail_msg .= ("
Account Number : ".$dlr_account."\n");
$mail_msg .= ("
Organization : ".$dlr_organization."\n");
$mail_msg .= ("
Contact : ".$dlr_contact."\n");
$mail_msg .= ("
Email Address : ".$dlr_email."\n");
$mail_msg .= ("
Password : ".$dlr_pass."\n");
$mail_msg .= ("\n");
$mail_msg .= ("\n");
// initialize recipients
$p_to_email[0] = ($dlr_email);
$p_to_name[0] = ($dlr_contact);
// send email
phpmail($p_to_email, $p_to_name, $g_email_from, $g_email_from_name, $mail_sub, $mail_msg);
// initialize response
$l_response = ("thanks");
}
else $l_response = ("forgot");
}
// get error message
else $l_response = ("forgot");
}
?>