Print Page | Close Window

username auto generate

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=21718
Printed Date: 29 March 2026 at 7:46pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: username auto generate
Posted By: gn00347026
Subject: username auto generate
Date Posted: 25 October 2006 at 9:53am
Hello all,
 
anyone know how to write a script that can make the username autocreate like
for the first user
use-  a00001 //a0001 is generate by webwiz automatically.
 
the second user
will use - a00002 //a00002 is generate by webwiz automatically.,
 
thanks



Replies:
Posted By: gn00347026
Date Posted: 02 November 2006 at 4:09am
Hello All,
any one know ?
Urgent
 
when user wants to registrate a new account, the username is provided by the fourm ... user cannot define


Posted By: MadDog
Date Posted: 02 November 2006 at 4:57am
You need to recode parts of register.asp to do this task. It wouldnt be hard, but it would have to be something custom coded by yourself.

-------------
http://www.iportalx.net" rel="nofollow">


Posted By: gn00347026
Date Posted: 02 November 2006 at 7:15am
LOLThank you for your reply
 
Since i'm new to asp, any simular example?


Posted By: dpyers
Date Posted: 03 November 2006 at 3:38pm
Set up an array containing all the characters/numbers you'd want to use.
Then use the asp random command to generate a number between 0 and the length of the array -1

Use that number to add the character from the array to a string.

loop through the random - add character instructions x number of times to generate the id.

Set the username text box value to the generated id and disable the text box.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: gn00347026
Date Posted: 06 November 2006 at 3:43pm
O.. i've tried .. but not success...Lamp


Posted By: gölge
Date Posted: 06 November 2006 at 5:12pm
if i understand truely;
you can use ID for that
 
for example at register.asp you can change that code
 
        'Read in the users details from the form
        If strMode = "new" Then strUsername = Trim(Mid(Request.Form("name"), 1, 15))
 
with that
Quote
    'SQL to get the new Author_ID from the database
    strSQL = "SELECT " & strDBTop1 & " " & strDbTable & strDbTable & "Author.Author_ID " & _
    "FROM " & strDbTable & "Author" & strDBNoLock & " " & _
    "ORDER BY " & strDbTable & "Author.Author_ID DESC" & strDBLimit1 & ";"
 
    'Query database
    rsCommon.Open strSQL, adoCon
 
 If strMode = "new" Then strUsername = "a00000"& CLng(rsCommon("Author_ID"))
 
  rsCommon.Close


Posted By: dpyers
Date Posted: 06 November 2006 at 8:31pm
Nice one! Simple, clean and elegant. Thumbs%20Up

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: gn00347026
Date Posted: 07 November 2006 at 5:42am
COOl .. what a genius...you are so strong ..man!!
I will try it today .. Thank you very much



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net