Buddy’s Blog | Art, design, code, and business

Nov/06

20

How to Display Username Suggestions in PHP Sign up Form?

PHP Logo

I recently work on a website project where the client wanted to suggest alternative usernames if it already existed in the database. At first I was not sure how this would work in code, but then it hit me, use the data in the form.

In the form was the user’s first and last name, their birthday, favorite pet (for security purposes), and more. With this data we can make logical suggestions to our user.

Download Example

HTML Output for “Bob Smith”

  • BobS
  • BSmith
  • BobS2006
  • BobS06
  • BSmith2006
  • BSmith06

As you can see we can extend this code further.

Share and Enjoy:
  • email
  • Add to favorites
  • Digg
  • del.icio.us
  • LinkedIn
  • Google Bookmarks
  • Yahoo! Bookmarks
  • Facebook
  • MySpace
  • Live
  • Twitter
  • Technorati
  • StumbleUpon

RSS Feed

1 Comment for How to Display Username Suggestions in PHP Sign up Form?

s40er | October 2, 2007 at 1:26 pm

Thanks for sharing this. It’s simple and effective.

Leave a comment!

<<