Jump to content
Larry Ullman's Book Forums

Chapter 18 Account Activation Email

Recommended Posts

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:


$page_title = 'Activate Account';
if(isset($_GET['x'], $_GET['y']) && filter_var($_GET['x'], FILTER_VALIDATE_EMAIL) && (strlen($_GET['y']) == 32)){
$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>";
echo '<p class="text-danger">You acount could not be activated. Please re-check the link or contact the system administrator.</p>';
$url = BASE_URL .'index.php';
header("Location: $url");
<?php include('includes/footer.php')?>
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...