//ini_set('display_errors', 1);
//error_reporting(E_ALL);
//require_once($_SERVER['DOCUMENT_ROOT'] . "/includes/config.php");
if(isset($_POST['send_email']) && $_POST['send_email']=="yes") {
include('Connections/lccommerce.php');
$SITE="AFM";
$site="AFM";
$p=$_REQUEST['p'];
// $p is page name
$email="" . trim($_POST["email"]) . "";
if ($email !="") {
$customer_sql = "SELECT * FROM customers WHERE customer_email = '" . $email . "' LIMIT 1";
$customer_result = mysql_query($customer_sql);
$found = mysql_num_rows($customer_result);
while ($customerow = mysql_fetch_assoc($customer_result)) {
$uid = $customerow["id"];
$customer_email=$customerow["customer_email"];
$password=$customerow["password"];
$customername = $customerow["customer_fName"] . " " . $customerow["customer_lName"];
}
}
if($found) {
// send email with password
$headers = 'From: noreply@americanfootballmonthly.com' . "\r\n" . 'Return-Path: postmaster@americanfootballmonthly.com' . "\r\n" . 'Content-Type: text/html';
$content = $customername . " you requested your password from AFMVideos.com - Air Raid QB Training
Password: " . $password . "
AFMvideos.com";
mail($email,"Password from AFM Videos - Open Grass Reads",$content,$headers);
$msg = "Password has been emailed";
} else {
// not found
$msg = "Email Address not found";
}
}
?>