JSHINER Posted February 27, 2009 Share Posted February 27, 2009 I have a form where a user enters a username. I want it to kick back an error if they enter their email address. How can I get it to see if a "@" or "." is in the entry? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 27, 2009 Share Posted February 27, 2009 first, for usernames, I usually use their email anyways. keeps things simpler IMO but, if you want to make sure they don't use their email, just make it so their username has to be alphanumeric and underscores. in php you can use if(!preg_match('/^\w+$/',$email)) die("Invalid username"); Quote Link to comment Share on other sites More sharing options...
JSHINER Posted February 27, 2009 Author Share Posted February 27, 2009 Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.