16 replies
I need to know where I can find a code
that will give me a random password to
people who sign up for my product via
an email.

Can anyone help?

Thanks
#password #random
  • Profile picture of the author osegoly
    Hi Mobiousman,

    I'll assume you're using PHP. I've used the function in the following URL before:

    PHP random password generator

    It's quite straightforward and it allows you to specify the length and strength.

    Hope that helps.
    {{ DiscussionBoard.errors[2121599].message }}
  • Profile picture of the author dsbonn
    do you also need the php function to send the email besides generating the random password?
    {{ DiscussionBoard.errors[2121731].message }}
    • Profile picture of the author mobiusman
      Originally Posted by dsbonn View Post

      do you also need the php function to send the email besides generating the random password?
      Yes I would need that.
      Can I program a random password in asp format.
      Where would be a good source to grenerate
      such passwords.

      thanks
      Signature
      Mobiusman talks about the Head Brain/Gut Brain system. Did you know you have two different brains?
      {{ DiscussionBoard.errors[2122083].message }}
  • Profile picture of the author Manfred Ekblad
    So, are you saying that you need ASP code that will generate a password and send that password to the people who sign up for your product?
    {{ DiscussionBoard.errors[2122132].message }}
    • Profile picture of the author mobiusman
      Not necessarily I just want to know where I can go to generate my own random password with out costing an arm and leg.

      I would prefer if there were some software (preferable free) that I could do this myself.

      thanks
      Signature
      Mobiusman talks about the Head Brain/Gut Brain system. Did you know you have two different brains?
      {{ DiscussionBoard.errors[2122164].message }}
  • Profile picture of the author Manfred Ekblad
    More questions then... lol

    A free software, in ASP? That will generate random passwords..? hmm...

    Are you planning on running this software automatically whenever someone signs up? Or is it something you do manually?

    If it's automatically, then you simply need to check out the PHP code that osegoly linked to, rewrite it into ASP and then your done.

    If you do it manually, you might wanna have a look at: Online Password Generator or just google for "free password generator"
    {{ DiscussionBoard.errors[2122971].message }}
    • Profile picture of the author myolay21
      What about using Javascript password Generator

      function GeneratePassword() {

      if (parseInt(navigator.appVersion) <= 3) {
      alert("Sorry this only works in 4.0+ browsers");
      return true;
      }

      var length=8;
      var sPassword = "";

      var noPunction = true;
      var randomLength = false;

      if (randomLength) {
      length = Math.random();

      length = parseInt(length * 100);
      length = (length % 7) + 6
      }


      for (i=0; i < length; i++) {

      numI = getRandomNum();
      if (noPunction) { while (checkPunc(numI)) { numI = getRandomNum(); } }

      sPassword = sPassword + String.fromCharCode(numI);
      }

      document.getElementById("txtLoginPassword").value = sPassword //add to password input text
      alert("Your new password is " + sPassword +"");
      return true;
      }

      function getRandomNum() {

      // between 0 - 1
      var rndNum = Math.random()

      // rndNum from 0 - 1000
      rndNum = parseInt(rndNum * 1000);

      // rndNum from 33 - 127
      rndNum = (rndNum % 94) + 33;

      return rndNum;
      }

      function checkPunc(num) {

      if ((num >=33) && (num <=47)) { return true; }
      if ((num >=58) && (num <=64)) { return true; }
      if ((num >=91) && (num <=96)) { return true; }
      if ((num >=123) && (num <=126)) { return true; }

      return false;
      }

      you just call GeneratePassword function to generate the password before post back to server. This can be use in any kind of server side script either php or asp or .net. You might need to rewrite a little bit on Javascript function to suit your need though.
      Signature

      If you catch two Rabbits you will lose them both.

      {{ DiscussionBoard.errors[2123734].message }}
  • Profile picture of the author jackmiloto
    I think working on with a server side script to generate random password like php is the best approach to this.
    {{ DiscussionBoard.errors[2123928].message }}
  • Profile picture of the author metabinltd
    I quickly knocked up a php password generator for you:

    <?=substr(base64_encode(time().time()-1049212),rand(6,10),rand(8,14))?>
    {{ DiscussionBoard.errors[2123954].message }}
    • Profile picture of the author myolay21
      Or if you just want to generate manually and keep for future reference . use "Password Safe".

      its free and you can download here "passwordsafe.sourceforge.net"
      Signature

      If you catch two Rabbits you will lose them both.

      {{ DiscussionBoard.errors[2123961].message }}
    • Profile picture of the author mobiusman
      Originally Posted by metabinltd View Post

      I quickly knocked up a php password generator for you:
      <?=substr(base64_encode(time().time()-1049212),rand(6,10),rand(8,14))?>[/QUOTE]

      Can I use this script in an email I send to my prospects?

      thanks
      Signature
      Mobiusman talks about the Head Brain/Gut Brain system. Did you know you have two different brains?
      {{ DiscussionBoard.errors[2125487].message }}
      • Profile picture of the author jminkler
        Originally Posted by mobiusman View Post

        <?=substr(base64_encode(time().time()-1049212),rand(6,10),rand(8,14))?>
        Can I use this script in an email I send to my prospects?

        thanks[/QUOTE]

        Remove the short tags before you do .. and assign it to a variable
        {{ DiscussionBoard.errors[2125858].message }}
  • Profile picture of the author jminkler
    Why not just set a separate field in the database with a "token", which they get in the confirmation email, then they get to set their password. I say this because it's easier to test if the password field is blank or a token is present when values are null, rather than a random password.

    People also hate random passwords they can't change ...
    {{ DiscussionBoard.errors[2125865].message }}
    • Profile picture of the author mobiusman
      Ok that is great idea but I want this password
      to be used only once and then it can't be used
      again.
      Is this possible?

      Thanks for your help.
      Signature
      Mobiusman talks about the Head Brain/Gut Brain system. Did you know you have two different brains?
      {{ DiscussionBoard.errors[2127136].message }}
  • Profile picture of the author Manfred Ekblad
    Yes it is possible.

    Any more questions?

    Seriously though, what you need is to keep track of when the user logs in. The first time the user logs in, you mark the password as "used". Whenever someone tries to login, you check if the password has been used or not.

    Why don't you post all the details about the full requirements you have, with a list of all the features you want in your login/password/email-script and it will be a lot easier for us to help you. Thanks in advance!
    {{ DiscussionBoard.errors[2127235].message }}
    • Profile picture of the author mobiusman
      Thanks for being so gracious with your know-how.
      This is what I need:
      (BTW - Every site I have uses a self-hosted Wordpress install. So whatever scripts I use must be compliant with Wordpress.

      Before my client first gains access to our private on-line seminar room she needs to fill out a registration form.
      The system will then generate a 4-digit password and email it out.
      When she finishes her session in the seminar room (about a full day) I don't want her, or anyone else for that matter, to be able to use that password to get into the on-line seminar work area ever again. (That's because they only have one shot at completing the e-seminar correctly. No coming back in later.)

      In other words I need the ability to de-activate that password manually.

      How can this be done?

      Thanks a heap for all your help. You guys are amazing!

      ...David
      Signature
      Mobiusman talks about the Head Brain/Gut Brain system. Did you know you have two different brains?
      {{ DiscussionBoard.errors[2128524].message }}

Trending Topics