What PHP setting will remove this feature?

MrPNW_

New member
In the attached image, please see the "IF" statment and it' conditions. Notice the grayed values "password:" and "hash:", which you can't delete because they're not really there. I'm using version 8.3.10 of PHP which I believe is the latest version. How do I remove this feature?

Thanks,
Blake

Screenshot.jpg
 
If this can help you:
It's just telling you what should go there. There are two parameters that you must set, I show you an example:
Code:
if(password_verify($pass, $data['pass'])){
    //code here...
 }
where $pass is the password that is in the database and $data['pass'] is the data you are retrieving from the login form.
By the way, you shouldn't put those $_SESSION[''] variables; there,
If you want I can show you a piece of short code for the login
 
If this can help you:
It's just telling you what should go there. There are two parameters that you must set, I show you an example:
Code:
if(password_verify($pass, $data['pass'])){
    //code here...
 }
where $pass is the password that is in the database and $data['pass'] is the data you are retrieving from the login form.
By the way, you shouldn't put those $_SESSION[''] variables; there,
If you want I can show you a piece of short code for the login
Thanks for your reply. I do understand the purpose of those prompts...I just wondered if there was a way to eliminate them. As far as the session variables and their placement, I could use a tip on why they shouldn't be there and when and where they should be set. Thanks again!
 
ahhh hahaha ok
I'm going to show you the complete structure and then I'll explain it to you.
Code:
1- require_once('../config.php');
    2- $user = htmlentities(addslashes($_POST['user']));
    3- $pass = htmlentities(addslashes($_POST['pass']));
    4- $user_exists=0;

    5- $sql = "SELECT * FROM table_users WHERE user = '$user'";
    6- $res = $conn->prepare($sql);
    7- $res->execute();
    8- while($file = $res->fetch(PDO::FETCH_ASSOC)){
    9-         $id = $file['id'];
    10-        $user1 = $file['user'];
    11-       if(password_verify($pass, $file['pass'])){
    12-           $user_exists++;
    13-        }
    14-   }
    15-
    16- if($user_exists!=0){
    17-        session_start();            
    18-        $_SESSION["user"] = $user1;
    19-       $_SESSION["id"] = $id;
    20-        header("Location:../index.php");
    21-   }else{
    22-        header("Location:../login.php?smserror");
    23- }
This is basically the structure of a login
As you can see, the only thing that goes inside the if() is the incremented $user_exits variable.
the variables $_SESSION[]; they must come after the variable super globar session_start(); This is so that it saves them with the session started and can use them in your code, that is, those $_SESSION[] variables; They should go there because they will be the unique sessions of each independent user who enters the site
 
Last edited:
P.S: The variables that go inside the while are the ones you rescue from the database and the session variables must go after session_start(); yes or yes. This is so that it is known that what those session variables are storing are the specific variables of the user who is browsing.
I hope I have explained it well and if that is what you wanted to know
 
Back
Top