Skip to content Skip to sidebar Skip to footer

Unique Identifier Link Value Receiving Failure In PHP Isset GET

I'm trying to verify registration via email with sending of unique identifier link to user. I use it from remote server. Server, username, password, database values are correct, w

Solution 1:

Your code looks in the $_POST array instead of $_GET

  if (isset($_GET['vkey'])) {
     $vkey = $_GET['vkey'];

Solution 2:

SUGGESTION: instrument everything possible, and post back what you find.

For example:

<?php
  echo "vkey=" . $_GET['vkey'] . "...<br/>";
  if (isset($_GET['vkey'])) {
     $vkey = $_GET['vkey'];
     echo "vkey=" . $vkey . "...<br/>";
     $mysqli = NEW MySQLi ('server','username','password','db');
     echo "mysqli: SUCCEEDED...<br/>";
     $resultSet = $mysqli->query("SELECT verified, vkey FROM registration WHERE verified = 0 AND vkey = '$vkey' LIMIT 1");
     echo "resultSet: SUCCEEDED...<br/>";

     echo "resultSet->num_rows=" . $resultSet->num_rows . "...<br/>";
     if ($resultSet->num_rows == 1)
     {
         $update = $mysqli->query("UPDATE registration SET verified = 1 WHERE vkey = '$vkey' LIMIT 1");
         echo "update: SUCCEEDED...<br/>");

         if($update){
            echo "Your account has been verified. You may now login.";
         } else {
            echo $mysqli->error;
         }
     } 
     else 
     {
         echo "This account invalid or already verified";
     }
    } else {
      echo "ERROR STATE: " . $mysqli->error . "...<br/>";
     die("Something went wrong");
  }
?>

And no, I can't think of "... why md5 string" could be the culprit. But I think the above instrument (or similar) might help us determine EXACTLY where the problem is occurring ... and thus how to resolve it.

'Hope that helps...


Post a Comment for "Unique Identifier Link Value Receiving Failure In PHP Isset GET"