max letters in <textarea> PHP?

blargh

New member
$count = count(explode(" ", $_POST['message']));
<?php
if ($count <= 10) {
print "Please be aware of the character limit";
} elseif($count >= 10) {
print "Sorry, but there are too many characters in your comment.";
}
?>






why isn't this working?
1) it allows more than 10 chars in the field,
2) always prints the "please be aware of ..." and never changes after i type more than 10 chars?
3) how can i make it so that after 10 chars, it won't allow anymore letters to be typed? for the form 'message', i'm using textarea, not input, so i can't put maxlength="10".
i copied and pasted wrong. the <?php goes before the $count
 
Back
Top