LeonLatex Posted April 22, 2021 Share Posted April 22, 2021 Sets up a mysqli connection script which I retrieve with included. If a user enters the wrong password or username then the connection to the database will be interrupted, and a message will be given about this. I want to do this in a different way. I want the .php connection script to work so that the script lets me or the ser know if it is the password that is incorrect or the username that is not authenticated. This way the user can find out if he / she has entered the wrong password or username. If both are incorrect, notice of this will be given. connection file is a fairly standard script. I have no clue about how to solve this problem. Is it posible at all? Do you know how to do it? <? $servername = "localhost"; $username = "username"; $password = "password"; // Oppretter tilkobling. $conn = new mysqli($servername, $username, $password); // Kontrollerer tilkoblingen. if ($conn->connect_error) { die("Tilkoblingen feilet: " . $conn->connect_error); } echo "Tilkoblingen var vellykket"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/312537-different-error-messages-in-connection-mysqli-script/ Share on other sites More sharing options...
Barand Posted April 22, 2021 Share Posted April 22, 2021 How to help your local neighbourhood hacker - let them know whether it was the username or the password that they got wrong. At least then they know they are half-way there. 1 Quote Link to comment https://forums.phpfreaks.com/topic/312537-different-error-messages-in-connection-mysqli-script/#findComment-1586115 Share on other sites More sharing options...
LeonLatex Posted April 22, 2021 Author Share Posted April 22, 2021 yes, i was thinking about it after i asked the question. So maybe i should forget it. Quote Link to comment https://forums.phpfreaks.com/topic/312537-different-error-messages-in-connection-mysqli-script/#findComment-1586117 Share on other sites More sharing options...
Barand Posted April 22, 2021 Share Posted April 22, 2021 Aside from that, mysql will only report that the combination of username, password and domain was invalid, not which portions. 1 Quote Link to comment https://forums.phpfreaks.com/topic/312537-different-error-messages-in-connection-mysqli-script/#findComment-1586118 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.