This is a discussion on "Prevent special character in username" within the PHP Forum section. This forum, and the thread "Prevent special character in username are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Prevent special character in username
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Prevent special character in username
Hi
I want prevent users to enter a username with special characters like space when they are registering a new one. How can i do it ? Is it regular expression or something else ? thnx
Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
|
|
|
|
#2
|
|||
|
|||
|
Re: Prevent special character in username
Yes you need to use a regular expression. This one only allows letters and numbers and uses the variable $username which would be $_POST['username']
|
|
#3
|
|||
|
|||
|
Re: Prevent special character in username
Thanx
Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
|
|
#4
|
|||
|
|||
|
Re: Prevent special character in username
also you can set the amount of characters you are allowing between the curly braces.
In my example you are allowing between 4 and 30 charaters |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| input $_SESSION['username'] = $username; on login page help | Aaron1988 | PHP Forum | 2 | Jan 28th, 2008 14:14 |
| Chinese Character | Sheela | Starting Out | 10 | May 24th, 2007 13:54 |
| Creating a character name | Throntel | Flash & Multimedia Forum | 2 | Dec 3rd, 2006 00:09 |
| Character Encoding Handling | spinal007 | Classic ASP | 0 | Jun 13th, 2006 11:21 |
| prevent refresh in asp | simonneaves | Classic ASP | 2 | Oct 10th, 2005 09:04 |