If I echo $codeee outside of the if loop, the value shows, but the value does not exist inside the loop which causes the UPDATE query to fail. How can I use the variable inside the loop?
PHP Code
require('connect.php');
$codeee = htmlspecialchars($_GET["recov"]);
echo $codeee;
$paso        = $confpaso    = "";
$pasoErr     = $confpasoErr = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST["paso"])) {
        $pasoErr = "Password is required";
    } else {
        $paso = md5(test_inputing($_POST["paso"]));
    }
    $confpaso = md5(test_inputing($_POST["confpaso"]));
    if ($confpaso != $paso) {
        $confpasoErr = "Passwords do not match";
    }
    $emailing = test_inputing($_POST["emailing"]);
    if ($pasoErr == $confpasoErr && $confpasoErr == "") {
        $changepaso = "UPDATE users SET password='$paso' WHERE forgotcode = '$codeee'";
        if ($conn->query($changepaso) === TRUE) {
            $tellthem = "Your password was changed";
        } else {
            $tellthem = "Something Happened, the password was not changed";
        }
    }
}
HTML CODE
    <form action=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]) ?> method="post"> 
    <div class="register-top-grid">
        <h3>FILL OUT YOUR INFORMATION TO CHANGE YOUR PASSWORD</h3>
        <div>
            <span>Email<label>*</label></span>
            <input type="text" name="emailing"  > 
        </div>
        <div>
            <span>Password<label>*</label><p style="color:red"><?php echo $pasoErr ?></p></span>
            <input type="password" name="paso"  > 
        </div>                                      
        <div>
            <span>Confirm Password<label>*</label><p style="color:red"><?php echo $confpasoErr ?></p></span>
            <input type="password" name="confpaso"  > 
        </div>
    </div></br></br>
    <input type="submit" value="submit">
    <p><?php echo $tellthem ?></p>
</form>
 
    