0

I have created an admin table and login panel for admin in my website. i inserted the data into admin table like

insert into admin values('admin',md5('admin123'))

the values got added and the password was added in the encrypted format.

But when i try to login to my admin panel its showing

incorrect password

what could be the issue?

Pradeep
  • 9,667
  • 13
  • 27
  • 34

2 Answers2

2

you can change links below for using php hash methods;

https://secure.php.net/manual/en/function.password-verify.php https://secure.php.net/manual/en/function.password-hash.php

with using

string password_hash ( string $password , int $algo [, array $options ] )

method u can hash your password, and pass it to your database with hashed. There are different kinds of hash methods changed by your parameters like PASSWORD_DEFAULT, PASSWORD_BCRYPT, PASSWORD_ARGON2I

Then you can use

bool password_verify ( string $password , string $hash )

method for verify your password which came from form with your hash that include your database

Kaan Ant
  • 36
  • 2
-2
 $new=md5('admin123');
 $query=mysqli_query($conn,"insert into admin values('admin','$new')");

Try this code