Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Password Script Help (https://www.warriorforum.com/programming/218175-password-script-help.html)

mobiusman 28th May 2010 10:26 PM

Password Script Help
 
Where can I get an ASP random password to send to people that sign up for my ecourse via email?

I need a random password that will be automatically sent to people via email and that will be no longer available once it has been activated. Can someone please tell me where I can get something like this?

Thanks

newmoon 29th May 2010 07:07 AM

Re: Password Script Help
 
Quote:

Function generatePassword( allowNumbers )
NUMLOWER = 48 ' 48 = 0
NUMUPPER = 57 ' 57 = 9
LOWERBOUND = 65 ' 65 = A
UPPERBOUND = 90 ' 90 = Z
LOWERBOUND1 = 97 ' 97 = a
UPPERBOUND1 = 122 ' 122 = z
PASSWORD_LENGTH = 6

' initialize the random number generator
Randomize()

newPassword = ""
count = 0
DO UNTIL count = PASSWORD_LENGTH
If allowNumbers Then
pwd = Int( ( NUMUPPER - NUMLOWER ) * Rnd + NUMLOWER )
Else
' generate a num between 2 and 10 ;
' if num > 4 create an uppercase else create lowercase
If Int( ( 10 - 2 + 1 ) * Rnd + 2 ) > 4 Then
pwd = Int( ( UPPERBOUND - LOWERBOUND + 1 ) * Rnd + LOWERBOUND )
Else
pwd = Int( ( UPPERBOUND1 - LOWERBOUND1 + 1 ) * Rnd + LOWERBOUND1 )
End If
End If

newPassword = newPassword + Chr( pwd )

count = count + 1
Loop

generatePassword = newPassword
End Function
now call it like:
Quote:

Generated with generatePassword(True): 850114
841824
717465
Quote:

Generated with generatePassword(False): CDYmSL
uGChYD
dvEOFU
source: I can't post link

newmoon 29th May 2010 08:59 AM

Re: Password Script Help
 
Hello,
You sent me an PM. I am tiny person here. I don't have privilege to reply.

I the thread I guess you said in ASP. ASP code won't work in the WordPress as WordPress is built using PHP.

mobiusman 29th May 2010 09:03 AM

Re: Password Script Help
 
Is this script in ASP?
If yes then is there another
script that will work in WP?

Thanks newmoon:confused:

newmoon 29th May 2010 09:11 AM

Re: Password Script Help
 
1 Attachment(s)
sir, I have already answer you.

here is the PHP code to generate password:
In PHP it is easier. giving one example:



please see the attachment. don't know why PHP code does not work here (even with PHP bbcode)


All times are GMT -6. The time now is 03:44 AM.