8 characters - form field
Posted: Sun Mar 20, 2005 1:10 pm
I’m trying to pop in a function that will stop anybody putting in more than 8 characters into a form field but I’m not too sure of the exact script I need.
I have been playing with this:
if ($_POST['email'] < 8 ) {
echo 'Your password can only be 8 characters or less';
?>
<input name="email" type="text" id="email" />
But it just opens in the browser with the error 'Your password can only be 8 characters or less' even before I get to run the form field.
Can anyone give me a few pointers as I’m still new to all this PHP stuff?
Thanks a mil
Brian
I have been playing with this:
if ($_POST['email'] < 8 ) {
echo 'Your password can only be 8 characters or less';
?>
<input name="email" type="text" id="email" />
But it just opens in the browser with the error 'Your password can only be 8 characters or less' even before I get to run the form field.
Can anyone give me a few pointers as I’m still new to all this PHP stuff?
Thanks a mil
Brian