PHP Tutorials: Random Password Generator

Create a random password generator from a specific character set. Visit the forum for help! phpacademy.info Follow on Twitter! twitter.com

Both comments and pings are currently closed.

28 Responses to “PHP Tutorials: Random Password Generator”

  1. mrjan95 says:

    @phpacademy Although my version might be better I must tell you that I really appreciate your work and thank you, because you taught me how to program in PHP.

  2. phpacademy says:

    @mrjan95 That’s a better way, but my tutorials are about exploring the use of lots of different methods. I tend to take long way around things so people can understand how different functions can be combined to work together. Thanks for posting this, though.

  3. mrjan95 says:

    Why are you complicating things?
    This is my version of the Random Password generator:

    function randompassword($lenght){
    $password=str_shuffle(‘abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890′);
    return substr($password,5,$lenght);
    }

  4. Killjoyxtrm says:

    I am writing in textwrangler, and when I click “run in terminal, it says that it cannot do that because it doesnt have a valid shebang line… can you help me at all?

  5. estibens79 says:

    Error al compilar

    Notice: Undefined variable: password in /opt/lampp/htdocs/password/index.php on line 10

  6. xxxrandomjamezxxx says:

    loved the vid,could you check mine out :) keep it up!

  7. tekriavideos says:

    easy to count :) a-z is 26 everyone knows add 1-9 add the 0 is 10 so 26+10 is 36 :)

  8. BABURAOIU says:

    thanks dude… already implemented that… thanks for the help though… :)

  9. UniqAssassin says:

    Put error_reporting(E_ALL & ~E_NOTICE); above your page. You won’t get those nasty Notice errors =D

  10. MoonWerewolf says:

    why do you dont get any error? i need to set
    $password = “”; before i can use $password .= $temp; and that makes my code ugly :(

  11. kaikajus says:

    5 Stars!! Exactly what I was searching for. Cheers :)

  12. tomcox2008 says:

    No dreamweaver will not cause the error, the error lies either within your script or your php/mysql setup. If you are unsure about how to set up an appache server running php and mysql, consider downloading something like WAMP or XAMMP, which will do the installation for you.

  13. hekaitomix94 says:

    @tomcox2008 I use dreamweaver cs 3.. maybe is this program the cause of error?

  14. tomcox2008 says:

    First of all do you have any error? If you are just getting a blank page, switch on the reporting function in PHP, so that you can identify what the problem is. Try these 2 lines of code at the top of your script, which will output all errors (only use for debugging. Here you go:

    error_reporting(E_ALL);
    ini_set(‘display_errors’, ’1′);

  15. hekaitomix94 says:

    why this php scripts doesn’t function with me?? i ve write all what have you write.. can you help me please?

  16. digesteddonkey says:

    thanks alex in incorporated this into my register/login page so now you register a new user and a random password get’s sent to their email address and then they can change it when they log in IF they choose.

  17. UnbreakableBeast says:

    I was searching for this for a long time. =p

  18. iwilpooponu says:

    do anayone know of anay program that puts the same emil and a deff random password in for like ssay myspace over and over?

  19. vb6help says:

    it should not only display “u”, it should display more symbols…

  20. TCHyper says:

    That would slow it down.. Add error_reporting(0); before..

  21. ti07shadow says:

    For those who dont know, if you get a undefined variable just next to this line
    $password = $password.$temp;

    add an @ before it
    @$password = $password.$temp;

    so you wont get that error if you happen to get it.

  22. AmrBanna says:

    Thanks!

  23. ucha19871 says:

    Hay Alex, way u don’t use PHPdesigner?
    here link to program
    h t t p : / / depositfiles(.)com/files/m17hcw08u

    here keygen

    h t t p : / / rapidshare(.)com/files/180773277/PHP.Designer.2008.Professional.v6.2.3.Incl.Keygen-25-09-2008(.)rar –no dashes

  24. eyeAMtwinkEE says:

    Do you have a server set up?

  25. meNiMONSTERs says:

    yeeeh for google chrome

  26. [...] PHP Tutorials: Random Password Generator | PHP Blog [...]

  27. [...] PHP Tutorials: Random Password Generator | PHP Blog [...]

  28. [...] PHP Tutorials: Random Password Generator | PHP Blog [...]