June 23, 2009

Generate Random Strings Using ASP/VBScript

This is a simple yet highly customizable function that allows you to generate random strings using VBScript that you can use in your ASP/VBScript applications. The random strings can be used for various purposes, including:

  • Login Systems
    • Random password for new registrations
    • Random password for users requesting password reset
  • Referral Codes
  • Promotional Codes
  • Primary Keys for tables where using integers as primary keys is not desirable

The following code is a VBScript translation of the php random string function I wrote earlier. It generates an 8 character long random string that contains 1 digit:

June 22, 2009

Generate Random Strings Using PHP

This is a simple yet highly customizable function that allows you to generate random strings using PHP. The random strings can be used for various purposes, including:

  • Login Systems
    • Random password for new registrations
    • Random password for users requesting password reset
  • Referral Codes
  • Promotional Codes
  • Primary Keys for tables where using integers as primary keys is not desirable

The following code example generates an 8 characters long random string that contains 1 digit: