Question : Server side validation for username field

Hi Experts,
I have a registration page for my website users, where they need to create an account before being able to log in the site.
I just need some kind of validation that checks the new username and if the user chooses a repeated username warn them to change their username, and it has been chosen before.
I am using Dreamweaver CS5 and Microsoft Sql server 2008, also my website built in coldfusion language.
Thanks

Answer : Server side validation for username field



Something like this ..
1:
2:
3:
4:
5:
6:
<cfquery name="checkUser" datasource="#request.datasource#">
  select 1 from users where username = '#form.username#'
</cfquery>
<cfif checkUser.recordCount>
  <cfthrow detail="Username already exists, please select a different user">
</cfif>
Random Solutions  
 
programming4us programming4us