- 1
Is my code right?
Please, if you can, check my code about register system. https://code.sololearn.com/WtFHamfcorZT/?ref=app
5 Antworten
+ 2
How can it not be right if it works
+ 2
Just giving you a few points to consider:
* This is PHP code but you are saving it as web code. That's why there's a tab for HTML, CSS and JS.
* Unless you are doing this for learning purposes, you should NEVER use the root account to establish a connection to the server. It is not safe. Create a new user in the server having granted access only to the database you need to use, with limited privileges.
* Only save the $_POST array content into local variables ($username, $email, $password, $confirm_password) when you have verified that there's data being submitted (`isset($_POST['submit'])`), not before.
* Additionally to checking password & confirm password; also check whether there is any user registered by the username & e-mail before proceeding with inserting new record into the `users` table.
Hth, cmiiw
0
I didnt checked it. I did code on travel on phone and cant test it
0
You can still type it on your phone
0
If you want people to try it which I guess that's what you want.... Ask your friends