Virgo_Enygma1981 Posted February 24, 2018 Share Posted February 24, 2018 I want to start off by saying I've learned more from your series of books than any other source on the market to date. That being said I am stumped with the user activation email using script 18.7. The user is registered just fine and the email it sends to the proper email, but when I click the link all I get is Object not found: error. I have no clue what to do from here I've gone over the code countless times and I have absolutely no answer. this is my activate.php: <?php require('includes/config.inc.php'); $page_title = 'Activate Account'; include('includes/header.php'); ?> <?php if(isset($_GET['x'], $_GET['y']) && filter_var($_GET['x'], FILTER_VALIDATE_EMAIL) && (strlen($_GET['y']) == 32)){ require(MYSQL); $q = "update users set active=null where (email='".mysqli_real_escape_string($dbc, $_GET['x']). "' and active='" . mysqli_real_escape_string($dbc, $_GET['y']) . "') limit 1"; $r = mysqli_query($dbc, $q) or trigger_error("Query $q\n<br>MySQL Error: " . mysqli_error($dbc)); if(mysqli_affected_rows($dbc) == 1){ echo "<h3>Your account is now active. You may now log in.</h3>"; }else{ echo '<p class="text-danger">You acount could not be activated. Please re-check the link or contact the system administrator.</p>'; } mysqli_close($dbc); }else{ $url = BASE_URL .'index.php'; ob_end_clean(); header("Location: $url"); exit(); } ?> <?php include('includes/footer.php')?> Link to comment Share on other sites More sharing options...
Larry Posted March 6, 2018 Share Posted March 6, 2018 Thanks so much for the nice words. I really appreciate it! As for your situation, what's the URL showing in the browser? It probably has an error in it. Link to comment Share on other sites More sharing options...
Marie Posted August 9, 2019 Share Posted August 9, 2019 I am also having a similar type of problem but not in all instances. I am testing on a live site. MOST of the time the email will get the activation link but when I click the link I get the message saying that the account could not be activated. BUT the information is in the database and the column says, "NULL". Link to comment Share on other sites More sharing options...
Necuima Posted August 13, 2019 Share Posted August 13, 2019 I had the same problem and I found that I had the BASE_URL set incorrectly in module config.inc.php Once I fixed that the activation script ran OK. Link to comment Share on other sites More sharing options...
Recommended Posts