- 1

Is my code right?

Please, if you can, check my code about register system. https://code.sololearn.com/WtFHamfcorZT/?ref=app

16th Aug 2019, 2:34 AM
Timofei Magi
Timofei Magi - avatar
5 Réponses
+ 2
How can it not be right if it works
16th Aug 2019, 3:38 AM
Cout
Cout - avatar
+ 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
16th Aug 2019, 7:45 AM
Ipang
0
I didnt checked it. I did code on travel on phone and cant test it
16th Aug 2019, 3:42 AM
Timofei Magi
Timofei Magi - avatar
0
You can still type it on your phone
16th Aug 2019, 3:43 AM
Cout
Cout - avatar
0
If you want people to try it which I guess that's what you want.... Ask your friends
16th Aug 2019, 3:49 AM
Cout
Cout - avatar