PHP Tutorials: Register & Login: User registration (Part 4)

Posted by: Admin  :  Category: Php

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Part of the ‘Register & Login’ Project from PHP Academy. This tutorials walks you through registering a user to allow them to log in to your site.

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

25 Responses to “PHP Tutorials: Register & Login: User registration (Part 4)”

  1. korvlord Says:

    @buddhagoulash i think its cause it encrypts it to md5 beforehand wich means that it is looking at the encryption length, try adding the md5 encryption after you have gone through the check password length, hope it helps if not send me a message and ill try to find a fix for you

  2. glsmaster Says:

    By the way wtf with all people requesting for the code. Write your own code and learn!

  3. glsmaster Says:

    I think that the use of a javascript for field verification should work a way better than querying the database each time the user posts invalid or wrong data. It saves bandwidth and server load IMHO.

  4. Vortex42 Says:

    Is it best to have your mysql_connect happen off the page in a folder outside of htmldocs or web?

  5. Vortex42 Says:

    Absolutely clear and well produced tutorials, Alex. Thanks so much. Really helps supplement my reading of the books to see someone putting all this together before my eyes. Excellent stuff. Subscribed!

  6. cire72093 Says:

    please post the code .__.

  7. MrKoolTutorials Says:

    Alex please can u put your register.php and login.php in the descripion because i have done this 2 now and i get an error with the validation.’s

  8. MrKoolTutorials Says:

    Help I Just keep Getting Password must be between 6 and 25 characters long! When It Is

  9. Zuberguber105 Says:

    @buddhagoulash yes i found out why, its because of the md5() function changing the password too early in the form, that the $password becomes the “fdsgnkw4nwkfn20fekmwlef” or whatever, to fix this, simply add the md5() [or in my case, the hash(‘sha256’)] right before you finish your form… for eg.

    …} else{
    $password = hash(‘sha256’, $password);
    $repeatpassword = hash(‘sha256’, $repeatpassword);
    echo ‘You have been successfully registered.’;
    }

  10. xygrax Says:

    Im also having the same issue. the page seems to be ok and says, registration is successful. but it’s not inserting into my database. please help.

  11. k3episode Says:

    @killerboduk999 Hello, You need to use ” if (isset(‘submit’)) { /*all your coding defining variables*/ } hope this helps!!! 🙂

  12. gymdani999 Says:

    Could anybody post the full working code?

  13. IlPadrinoRulla Says:

    Hi all,first of all i’m an italian boy so sorry for my bad english xD. Thanks a lot for this great tutorial. It helped me so much. For everyone that have some problem with the querys i resolved with:

    $queryreg = mysql_query(“INSERT INTO `users`(id, username, password, date) VALUES (NULL, ‘$fullname’, ‘$username’, ‘$password’)”);

    I hope that it will help you. Bye!

  14. rinsa89 Says:

    even after typing the correct data into all the fields and clicking register..i donot get success…i keep gettin passwords donot match..any helppp…plssss…

  15. buddhagoulash Says:

    @buddhagoulash to fix this problem I had to encrypt the password after the strlen() check, in case others are having the same issue.

  16. buddhagoulash Says:

    @buddhagoulash this is the problem I’m having…I get the ‘password is too long’ error message no matter how long my password is…any ideas why?

  17. buddhagoulash Says:

    When we check the password length, isn’t it already md5 encrypted? In that case it will always be more than 25 chars long, am I right?

  18. buddhagoulash Says:

    When we check the password length, isn’t it already md5 encrypted? In that case it will always be more than 25 chars long, am I right?

  19. michaelangelorayco Says:

    even i specify the fields of the database on the sql command, i still cannot save my data in my database. but i don’t get errors. anyone?

  20. killerboduk999 Says:

    Notice: Undefined index: fullname in C:xampphtdocsxamppawlog inloginregister.php on line 7

    Notice: Undefined index: username in C:xampphtdocsxamppawlog inloginregister.php on line 8

    Notice: Undefined index: password in C:xampphtdocsxamppawlog inloginregister.php on line 9

    Notice: Undefined index: repeatpassword in C:xampphtdocsxamppawlog inloginregister.php on line 10

    this is the error but the program works properly how do i remove that error

  21. killerboduk999 Says:

    @codyjd2010 plssss help me its still error says…..Undefined variable: name

  22. sitishorty Says:

    when i first click on the Register? link, some how the localhost/register.php shows this error:

    Notice: Undefined index: submit in C:xampphtdocsloginsessionregister.php on line 5

    same goes to index: fullname, username,password, repeatpassword.
    can someone tell me how to fix this error?

  23. obn2000 Says:

    @murkata86
    Hi, thank you for help! it´s working.
    I coldn´t insert data in mysql, you help was a sucess.

  24. rvcsystems Says:

    Very clear and helpfull. Thanks

  25. hmhross Says:

    great tutorials. i think it would be helpful if you upload the .php documents so that we can compare our codes. the if and else statements here get very complex.

Leave a Reply

*