How to disable html input in a form?

Discussion in 'PHP' started by hash1, Dec 22, 2010.

  1. #1
    Im trying to figure out how I can disable users on my site from being able to post html codes within a form I have on my website.

    Wondering if anyone has a quick fix for this?
     
    hash1, Dec 22, 2010 IP
  2. krishmk

    krishmk Well-Known Member

    Messages:
    1,376
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    185
    #2
    Try using strip_tags() which should strip all html tags.. But if there is any broken html tag it might strip non html data as well..
     
    krishmk, Dec 22, 2010 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    you can also use preg replace
     
    Bohra, Dec 22, 2010 IP