Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - username auto generate
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

username auto generate

 Post Reply Post Reply Page  12>
Author
gn00347026 View Drop Down
Newbie
Newbie
Avatar

Joined: 17 February 2005
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote gn00347026 Quote  Post ReplyReply Direct Link To This Post Topic: username auto generate
    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
Back to Top
gn00347026 View Drop Down
Newbie
Newbie
Avatar

Joined: 17 February 2005
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote gn00347026 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
gn00347026 View Drop Down
Newbie
Newbie
Avatar

Joined: 17 February 2005
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote gn00347026 Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2006 at 7:15am
LOLThank you for your reply
 
Since i'm new to asp, any simular example?
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
gn00347026 View Drop Down
Newbie
Newbie
Avatar

Joined: 17 February 2005
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote gn00347026 Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2006 at 3:43pm
O.. i've tried .. but not success...Lamp
Back to Top
gölge View Drop Down
Groupie
Groupie


Joined: 16 April 2005
Location: Turkey
Status: Offline
Points: 182
Post Options Post Options   Thanks (0) Thanks(0)   Quote gölge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.