Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- form validation using php
May 14, 2008, 6:18 am
rate this thread
i need to validate a field in a form where a user enters their
lodgement number as part of a registration form. this lodgement number
can have letters, numbers, spaces and special characters. i do not
know exactly what those special characters are, so do i have to define
the type of special characters and validate accordingly.
presently my php code for validating the lodgement number is
$lodgementtf = $_POST["lodgementtf"];
if($lodgementtf =3D "" || !preg_match("/^[a-zA-Z0-9_ <]+$/",
echo "display error message":
i also have another way of validating
if($lodgementnumber =3D "" || !preg_match("/^[a-zA-Z0-9_ !-@=A3$%^&*()]+
$/", $lodgementnumber) )
does this mean that the special characters can only be = a space AND
_!-@=A3$%^&*() and no other special characters.
- » First post, first Big question. html layout engine, looking for a howto
- — Previous thread in » PHP Scripting Forum