Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 11th, 2001, 06:48 AM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
Thumbs up Suggest a Username

I'm alittle stumped on this one

I need to come up with a way, when a person submits a form with a username selection, that if the username is already been choosen, to "suggest" 5 random usernames that haven't been choosen, something like if they where to enter "Mickyd" and it was already taken to have the script generate 5 that are similar but not already in the database. I've seen this done on various membership sites, but not quiet sure how this would be done.

Any suggestion or tips would be greatly appreciated!
__________________

Thunder Rain Internet Publishing

Custom Programming & Database development
Providing Personal/Business
Internet Solutions that work!

Reply With Quote
  #2  
Old July 11th, 2001, 07:18 AM
DropKick DropKick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 2 DropKick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to DropKick
Well there is 2 things I can suggest... 1 take the string and add 5 random chars (numbers or letters) on the end with the 'rand' function, then when each is generated check to see if it exists.. if not then store and go onto the next one. The other way I can suggest is if you have a text file full of words, and then take of say the first 3 characters of the username and use the match command to find similiar words?

There is probably a better way of doing it, but what the hell!

Reply With Quote
  #3  
Old July 11th, 2001, 07:45 AM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
Thumbs up

Quote:
Originally posted by DropKick
Well there is 2 things I can suggest... 1 take the string and add 5 random chars (numbers or letters) on the end with the 'rand' function, then when each is generated check to see if it exists.. if not then store and go onto the next one. The other way I can suggest is if you have a text file full of words, and then take of say the first 3 characters of the username and use the match command to find similiar words?

There is probably a better way of doing it, but what the hell!


DropKick,

Interesting! I think the first one would probably be the most efficent

You wouldn't happen to have a sample code laying around,..by chance??

Mickalo

Reply With Quote
  #4  
Old July 11th, 2001, 07:57 AM
robert.swift's Avatar
robert.swift robert.swift is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Manchester, UK
Posts: 80 robert.swift User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Hi,

I use Data::Random to generate random data. It is quite a handy module as it can generate numbers, letters, dates, combinations etc. The only limitation I have had has been the length of random data from a single call to the library.

It not necessarily the best solution but it works for me


It's on the CPAN (http://search.cpan.org) but I can't get the link at the moment because my stoopid ADSL ISP has got a major cache problem that rotates round sites I access - aargh!

Got there at last

http://search.cpan.org/search?dist=Data-Random
__________________
Robert.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Suggest a Username


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT