SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2002
    Location
    Kentucky, USA
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to disable html?

    How do you disable html in things? Like message boards do and stuff. I need the tag to disable it.

  2. #2
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can run your text through htmlspecialchars() in PHP which will display the text exactly as it was typed (where the HTML is actually displayed).

    PHP Code:
    $txt htmlspecialchars($txt); 
    or, if you want to actually remove the HTML, you can use strip_tags().
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2002
    Location
    Kentucky, USA
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by DR_LaRRY_PEpPeR
    you can run your text through htmlspecialchars() in PHP which will display the text exactly as it was typed (where the HTML is actually displayed).

    PHP Code:
    $txt htmlspecialchars($txt); 
    or, if you want to actually remove the HTML, you can use strip_tags().
    Sweet, im really advanced in php and i didnt even know those functions existed, LoL, silly me.

  4. #4
    SitePoint Addict Clete2's Avatar
    Join Date
    Mar 2002
    Location
    Columbia, South Carolina
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    silly, silly you... tsk, tsk...
    My Blog
    My Photography Website
    Linux user #339185


Bookmarks

Posting Permissions

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