skip to Main Content

I’m following this tutorial to build the user registration system (https://www.positronx.io/build-php-mysql-login-and-user-authentication-system)

I have successfully posted the user registration info to the SQL database but I’m stuck in the user verification part.

I tried to click the link in the verification email but turns out it returned an error err_connection_refused. I am wondering if I need to change the localhost in the href to my domain name?

Also, I’m not sure what is php-user-authentication, I couldn’t find that folder in my WordPress cpanel.

Thank you guys for your help and I hope it’s not a silly question.

if($sqlQuery) {
 $msg = 'Click on the activation link to verify your email. <br><br>
  <a href="http://localhost:8888/php-user-authentication/user_verificaiton.php?token='.$token.'"> Click here to verify email</a>';
}

2

Answers


  1. Mail veryfication is really easy

    I would recommend you to use site name instead of port.
    Like : http://localhost/domain/php-user-authentication/user_verificaiton.php?token=$token

    Above url will simply lead you to your localhost site, exact on that site.
    then simple:

    <?php
        $token = $_GET['token'];
        //now you can verify this token from db
    ?>
    

    user_verification.php is the file where you get $token available

    Login or Signup to reply.
  2. Just changing the following line

     $link = "http://localhost:8888/php-user-authentication/user_verificaiton.php?token=" . $token;
    

    to

     $link = "./php-user-authentication/user_verificaiton.php?token=" . $token;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search