asked on
$q = "INSERT INTO users (username, email, pass, first_name, mid_initial, last_name, active, agree, date_expires) VALUES (?, ?, ?, ?, ?, ?, ?, 'Agree', DATE_ADD(NOW(), INTERVAL 2 YEAR) )";
// Prepare the statement:
$stmt = mysqli_prepare($db, $q);
// Bind the variables:
mysqli_stmt_bind_param($stmt, 'sssssss', $u, $e, $p, $fn, $mi, $ln, $a);
// Assign the values to variables:
$u = $_POST['username'];
$e = $_POST['email'];
$fn = $_POST['first_name'];
$mi = $_POST['mid_initial'];
$ln = $_POST['last_name'];
//$a = $_POST['active'];
// Execute the query:
mysqli_stmt_execute($stmt);
// Send the email:
$body = "Thank you for registering at Tired Of Being Ripped Off. To activate your account, please click on this link:\n\n";
$body .= BASE_URL . 'ActivateLU.php?x=' . urlencode($e) . "&y=$a";
mail($trimmed['email'], 'Registration Confirmation', $body, 'From: admin@tiredofbeingrippedoff.com');
// Finish the page:
include('ThankYou.html'); // Include the Thank You For Registering
exit(); // Stop the page.