[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Ciphertje [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 6 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> password generator - Coldfusion - Advanced Techniques

password generator - Coldfusion - Advanced Techniques

hi i have a form, when the user presses submit i want a username and password to be generated and put into my Username and password column in my table also can the username and password be casesensitive and include numbers i am using micorsoft access many thanks...

  1. #1

    Default password generator

    hi i have a form, when the user presses submit i want a username and password
    to be generated and put into my
    Username and password column in my table

    also can the username and password be casesensitive and include numbers
    i am using micorsoft access

    many thanks

    Craig77 Guest

  2. #2

    Default Re: password generator

    You can define a variable with all the characters you'd like to allow in a
    password, then use RandRange to select characters randomly. In the attached
    code, this will generate a 10-character random password.

    -Paul



    <CFSET charlist =
    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw xyz1234567890!$%^&*">
    <CFSET pw = "">
    <CFLOOP INDEX="sub" FROM="1" TO="10">
    <CFSET pw = pw & Mid(charlist, RandRange(1, Len(charlist)),1)>
    </CFLOOP>
    <CFOUTPUT>Password is: <STRONG>#pw#</STRONG></CFOUTPUT>

    dempster Guest

  3. #3

    Default Re: password generator

    Excellent posting, most appreciated. I shall also be using your code.
    terribleted Guest

  4. #4

    Default Re: password generator

    If you are using msaccess, I don't think username and password can be case
    sensitive. I could be wrong though, again.

    The topic title is potentially misleading. It suggests that you will be
    generating passwords for your users rather than having them make up their own.
    That will certainly decrease the liklihood of them remembering that password,
    so it's just as well that you are not doing that.

    You might want to look at the hash function. Basically it prevents the
    database owner (probably you) from being able to read the user's password.
    That may be good, or it may be bad. It might also mean that, if they forget
    it, you can't send it to them.

    Dan Guest

  5. #5

    Default Re: password generator

    ok thanks i have the gernerater code inside a form which shows the details of
    the user i.e. name address, username, password

    but everytime i go to the record a new password is gemerated, is there a way
    of coding

    if password appears in column show it, and then could i have a btn to generate
    the password if required?

    <CFSET charlist =
    "ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxy z23456789$%&*">

    <CFSET pw = "">
    <CFLOOP INDEX="sub" FROM="1" TO="10">
    <CFSET pw = pw & Mid(charlist, RandRange(1, Len(charlist)),1)>
    </CFLOOP>
    <CFOUTPUT>Password:

    <cfinput type="text" name="Password" value="#pw#">

    </CFOUTPUT>

    Craig77 Guest

  6. #6

    Default Re: password generator

    What a coincidence dempster.. I was looking for something like that yesterday
    on google.
    Great Thanks.

    To get back on Topic,
    If i get you right Craig, you want the user to push a button to generate a new
    password?

    I suggest to generate a new password just before inserting the new user in the
    database. And not in the form. And then show the password to the user on the
    page. Or, even better, e-mail them their password, and validate their e-mail at
    the same time.

    Oh now i think i know what you mean..
    Try this:

    <cfif not len(youruserquery.passwordfield)>
    <!--- generate a new password code goes here ---->
    <cfelse>
    <cfset pw = youruserquery.passwordfield>
    <cfif>

    <form lalala>
    <input type="password" Value="#pw#">
    </form>

    Ciphertje Guest

  7. #7

    Default Re: password generator

    ok i have the code below which i need to be passed to my update.cfm so the
    username and password get put into column UserName, Password

    Any ideas

    FORM

    <cfform name="Generate" method="post" action="Generate.cfm">
    To generate a new Username &amp; Password Click Generate <input
    type="submit" name="Submit" value="Generate">

    <CFSET charlist =
    "ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxy z23456789$%&*">
    <CFSET un = "">
    <CFLOOP INDEX="sub" FROM="1" TO="10">
    <CFSET un = un & Mid(charlist, RandRange(1, Len(charlist)),1)>
    </CFLOOP>

    <CFSET charlist =
    "ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxy z23456789$%&*">

    <CFSET pw = "">
    <CFLOOP INDEX="sub" FROM="1" TO="10">
    <CFSET pw = pw & Mid(charlist, RandRange(1, Len(charlist)),1)>
    </CFLOOP>
    </cfform>

    UPDATE.CFM
    <cfupdate datasource="DPSGuide" tablename="OrganisationNameList">

    <cflocation url="OrganisationEdit.cfm" addtoken="false" />

    Craig77 Guest

  8. #8

    Default Re: password generator

    ok managed to sort it a bit, but i now get the following error
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
    Access Driver] Syntax error (missing operator) in query expression
    &apos;&apos;fUGg88jzd6&apos; Password=&apos;7ZyiGuh7FD&apos;&apos;.

    The error occurred in E:\Inetpub\vs111061\Generate.cfm: line 8

    6 : SET UserName='#form.UserName#'
    7 : Password='#form.Password#'
    8 : WHERE OrganID='#OrganID#'
    9 : </cfquery>
    10 :



    UPDATE.CFM

    <cfquery datasource="DPSGuide">
    UPDATE OrganisationNameList
    SET UserName='#form.UserName#'
    Password='#form.Password#'
    WHERE OrganID='#OrganID#'
    </cfquery>

    <cflocation url="OrganisationEdit.cfm" addtoken="false" />


    FORM

    <form name="Generate" method="post" action="Generate.cfm">
    <input type="hidden" name="OrganID" value="#OrganID#">
    To generate a new Username &amp; Password Click Generate

    <CFSET charlist =
    "ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxy z23456789">
    <CFSET un = "">
    <CFLOOP INDEX="sub" FROM="1" TO="10">
    <CFSET un = un & Mid(charlist, RandRange(1, Len(charlist)),1)>
    </CFLOOP>
    <cfoutput>
    <input type="hidden" name="UserName" value="#un#"></cfoutput>

    <CFSET charlist = "ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxy z23456789">

    <CFSET pw = "">
    <CFLOOP INDEX="sub" FROM="1" TO="10">
    <CFSET pw = pw & Mid(charlist, RandRange(1, Len(charlist)),1)>
    </CFLOOP>

    <cfoutput><input type="hidden" name="Password" value="#pw#"></cfoutput>
    <input type="submit" value="Generate">
    </form>

    Craig77 Guest

Similar Threads

  1. yet another xml generator
    By Martin in forum PERL Modules
    Replies: 5
    Last Post: March 20th, 10:40 AM
  2. Letter Generator
    By ralph_noble@hotmail.com in forum Coldfusion - Getting Started
    Replies: 5
    Last Post: July 1st, 07:47 AM
  3. Free Random Password Generator
    By FreewareTown.com in forum Linux / Unix Administration
    Replies: 17
    Last Post: January 27th, 09:25 PM
  4. Free Network Tools - Random Password Generator - Link Counter - Hit Counter
    By FreewareTown.com in forum Linux / Unix Administration
    Replies: 0
    Last Post: August 30th, 09:20 AM
  5. Generator 2 r3 on Windows XP
    By Pål in forum Macromedia Flash Sitedesign
    Replies: 1
    Last Post: February 16th, 09:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •