16 Responses to “PHP Tutorials: Login/Register Email Activation (Part 2)”

  1. damdempsel says:

    Does he show the global.php page? I can’t seem to find it.

  2. Excelsoft says:

    in activate.php u need to select a unique field as well, as depending only on $code is not enough, so mysql_num_rows($check) not nesessarli will equal only 1, suppose a user with activation code=123 for ex, is activated, and a new registered user has the same random code (no guarantee tht this couldnt happen) so when this new user tries to activate his account the script will say u r already activated, although he’s not!

  3. Thefakerr says:

    OMFG .. 20mins of footage !

  4. adrianseverus says:

    Wow dude this is like a Scam page…:D

  5. fastdrugs says:

    @superawesomesuperkid

    yes you can do all in one page but, there is always a refresh

  6. superawesomesuperkid says:

    Would setting the action as “#” or”#register” do anything to this? I want everything to run on one page. No refreshes.

  7. RisenVids says:

    Part 2: Generally your tutorials are not bad for beginners, but because they are for beginners you should take extra care that you teach the newbies how to use PHP correctly. Means proper input validation, correct escape methods, and so on. For the register script, username and email column in the DB should be UNIQUE to avoid to have more than one account with the same user name/login name.
    Anyway, keep up your good work. :)

  8. RisenVids says:

    The tutorial has several weaknesses and is vulnerable to injections. You always should use mysql_real_escape_string and never addslashes, because addslashes does A) alters the original data physically B) is does not escape all potentially dangerous. See online docu for details, where it is explained.
    It’s possible to activate ALL inactive account with a simple injection. For UPDATE statements you also should always use LIMIT or little errors can result in applied changes to the whole database.

  9. TheFos23 says:

    Thanks for lot without PHP Tutorial

  10. cutieyuffie says:

    Totally agree with you here!

    Alex you have saved ‘my’ technologically inclined life xD !

    Thank you!! ^_^

  11. stategamer says:

    okNotImportant i agree with u we need a tutorial about regular expressions :D

    nice tutorial again alex

  12. qabandiman says:

    in activate.php

    the $code variable should also be filtered with addslashes() for security.

  13. nickvth2009 says:

    Oh yeah, forgot to say that you could better use a session ID as number, this will avoid activation problems.

  14. ludmil1 says:

    Hi i did similar script and I used the time() function (at the time of registration) for the conformation code,

  15. xiz90 says:

    Amazing contribution to the web development community!

  16. okNotImportant says:

    thanks for this vid
    alex please..Do you have any idea about regular expression?
    we need it :(
    thanks again ..