note 50744 deleted from function.preg-match by nlopess

From: Date: Tue, 08 Mar 2005 19:17:51 +0000
Subject: note 50744 deleted from function.preg-match by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-86125@lists.php.net to get a copy of this message
Note Submitter: ha AT hasanaydemir DOT co DOT uk ---- Checks if username and/or password conatins spaces, if it does than stops the registration process and asks user to reenter the username and/or password. <?php $username = "hasanaydemir"; $password = "my password"; if ((preg_match("/ /i", "$username")) || (preg_match("/ /i", "$password"))) { echo "Your username of password contains spaces, please write without spaces."; include 'login_form.html'; } ?>

« previous php.notes (#86125) next »