Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder Microsuck's Avatar
    Join Date
    Oct 2011
    Location
    127.0.0.1
    Posts
    123
    Thanks
    44
    Thanked 5 Times in 5 Posts

    Set Character Limit on Textarea

    Hello.

    I have a textarea and I need it to only allow a maximum of 1000 characters. How can I do that?

    I am currently using JavaScript to do this, but anyone that knows how to disable JavaScript can bypass it.

    And I used this PHP code, to try and stop it, but it still inserts the post into the database even though it redirects as well. I know this isn't the PHP forum, but I thought I'd add this, just so nobody asks.

    PHP Code:
    if (strlen($post) > 1000) {
    header('Location: 1000chars.html');

    Last edited by Microsuck; 11-02-2011 at 02:30 AM.

  • #2
    Regular Coder Microsuck's Avatar
    Join Date
    Oct 2011
    Location
    127.0.0.1
    Posts
    123
    Thanks
    44
    Thanked 5 Times in 5 Posts
    My stupidity!

    I placed that line of code after the SQL query. I guess I dun goofed.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •