troubleshooting Question

I want to delete potential users from the database automatically if they have not activated their account.

Avatar of Wanda Marston
Wanda MarstonFlag for Canada asked on
DatabasesMySQL Server
8 Comments2 Solutions27 ViewsLast Modified:
At this point users register and then an email is sent to them. So their information is in the database. There is a link in the database that they click and then that changes their input in the "active" column to NULL. They then can log in to their account if the active column says Null. Many registrants do not active their account. I also feel that some of these registrants are FAKE users so it is possible that their email is phony. IF A CAPTCHA is the answer then I would prefer not to use the image style CAPTCHA. I personally do not like to use those when I am trying to get into a website.

The code I am now using.
     $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:
// 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:');
// Finish the page:
               include('ThankYou.html'); // Include the Thank You For Registering
                exit(); // Stop the page.  

Join our community to see this answer!
Unlock 2 Answers and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros