Click here to Skip to main content
14,766,373 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I wrote the code based on you tube videos for a PHP Tutorial - Simple Login Form, in the example it retrieves the password and username.

What I have tried:
Posted
Updated 16-Dec-20 10:16am
v2

No, we can't help.
We have no access to your code, your DB, or even your screen to see what might be going on when you run your code - and you need all three of those to even begin to fix it!

So it's time for you to break out the debugger and start looking for what you code is doing, and what it was not doing that you expected: PHP: About debugging in PHP - Manual[^]
   
Simple answer: don't.

In order to retrieve the password, you would have to store the password in plain text, or using a reversible encryption algorithm. Neither option is acceptable for storing users' passwords.

Store a salted hash of the password, using a unique salt per record, and multiple rounds of a secure hashing algorithm.
Secure Password Authentication Explained Simply[^]
Salted Password Hashing - Doing it Right[^]

PHP even has built-in methods to help you do the right thing:
PHP: password_hash[^]
PHP: password_verify[^]

99% of YouTube programming videos aren't worth the paper they're printed on. The one you're following doesn't sound like it's made it to the other 1%.
   
Quote:
Code doesn't want to retrieve password and username from the database, could you help.

Sure, it is rather simple. You have a secret bug in you secret code from a secret tutorial.
Keep your secrets secret if you don't want help.

Asking questions is a skill[^]
Some guidelines for posting questions in the forums[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900