note 50744 added to function.preg-match
| From: | haAThasanaydemirDOTcoDOTuk at osu1 dot php dot net | Date: | Tue, 08 Mar 2005 17:15:58 +0000 |
| Subject: | note 50744 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86116@lists.php.net to get a copy of this message | ||
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';
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50744
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50744&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50744&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50744&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50744&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50744&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50744&report=yes
Search -- http://master.php.net/manage/user-notes.php