Syntax?

From: Date: Wed, 03 Jan 2001 20:04:30 +0000
Subject: Syntax?
Groups: php.general 
Request: Send a blank email to php-general+get-32540@lists.php.net to get a copy of this message
Hey! This is the first time I have written to a newsgroup...... And being a newbie, I need help ;) OK, I have several scripts I have successfully done. At the moment, I'm working on setting up a database for friends. The only thing I am really struggling on is prohibiting them from using non alpha-numeric (I don't even know whether that's the right term(!)) in their alias when signing up. Basically, their name should comprise of letters, numbers (if necessary), the underscore character and nothing else. I put this code together, which basically varifies whether the name is comprised of numbers only: if (ereg ("([0-9])", $alias)) { echo "Okie Dokie $alias, you can register a name comprised of numbers."; } else { echo "Invalid name: $alias"; } I don't want them to be able to use spaces either. Please try to bear in mind that I'm not only relatively new to PHP, but a complete novice to Perl. Can anyone help? Thanks ;) James.

« previous php.general (#32540) next »