Home » PHP » PHP best & secure user registration with login example

PHP best & secure user registration with login example

This example is explaining how to create secure user registration using php and mysql.This is very secure using salt value into database users table.It help to avoid sql injection and dictionary attack from hackers. This way is secure and better than md5 encryption method.
Here tested code.
This is have two parts.
1-User Registration
2-User Login

sql-injection

1-User Registration

From here everything is explained very simply to understand all visitors.

Here is the registration form.

To more simple I’ll show the table structure.
secure user login table

Users Table.

Here is the php script to process the form.This can put in the same registration.php file.
I have not added database connection details here.Hope you can create that.If you don’t know that let me know.I’ll add.

Additional:-
mysql_real_escape_string()


2-User Login

This is the login form.

You can put this script in the login.php same as registration.

That’s only. Hope everything are clear and understandable. If you have any questions,suggestions put the comment below.Appreciate and glad to help you. 🙂
Thank you.

Tags

Similar posts

  • mandeep

    hello dear can you help in cakephp 3.2 for user login form with fb, gmail?how i do it .please help me i am new in cakephp.So please tell me step by step .hope you will reply me soon

  • Paridel’s Print Adonis

    In both php files, I do not see when you are connected to the database.