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 3 of 3
  1. #1
    Regular Coder UrbanTwitch's Avatar
    Join Date
    Apr 2006
    Posts
    485
    Thanks
    44
    Thanked 1 Time in 1 Post

    Allow BBCode but Not HTML

    OK, so I got a problem. I want my users to be able to post BBCode in their message but NOT html.
    How do I do this?

    I can't use htmlentities because then they can't use things like quotes or emotions.

    Help?
    Formerly MysticScript

    6+ years club

  • #2
    New Coder
    Join Date
    Apr 2006
    Location
    Planet Earth
    Posts
    59
    Thanks
    1
    Thanked 8 Times in 8 Posts
    For something simple use strip_tags() function.

    PHP Code:
    $clean strip_tags($_POST['comment']); 
    http://us3.php.net/manual/en/function.strip-tags.php

  • #3
    Regular Coder
    Join Date
    Mar 2006
    Posts
    238
    Thanks
    3
    Thanked 37 Times in 37 Posts
    PEAR has the BBCode Parser ... At least it could be worth looking at it I think.


  •  

    Posting Permissions

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