How to disable html code in textarea?

Discussion in 'PHP' started by hhheng, May 21, 2007.

  1. #1
    Currently I got spam submissions to my directory, and the description they put was like:

    What's the php script and how to add the script to the server side to disable the html code in the description box?


     
    hhheng, May 21, 2007 IP
  2. dzysyak

    dzysyak Peon

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    First of all add some type of "human check". Than you can use strip_tags() function or just check posted value for allowed characters with eregi() or preg_match()
     
    dzysyak, May 21, 2007 IP
  3. manilodisan

    manilodisan Peon

    Messages:
    224
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I use a function to strip tags etc. and a captcha + I don't reverse the tags (I leave them as xhtml on the output). Where I do want html to be interpreted as HTML, I use bbcodes to make sure that only what has a function to parse and generate will be converted.
     
    manilodisan, May 21, 2007 IP
  4. DeViAnThans3

    DeViAnThans3 Peon

    Messages:
    785
    Likes Received:
    83
    Best Answers:
    0
    Trophy Points:
    0
    #4
    DeViAnThans3, May 22, 2007 IP
  5. PHPGator

    PHPGator Banned

    Messages:
    4,437
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    260
    #5
    Possibly use an image verification script alongside of your form. Those are those little images with random text on them that you have to repeat accurately to submit a form. There are several online but might be difficult to impliment in a pre-built script.
     
    PHPGator, May 22, 2007 IP
  6. hhheng

    hhheng Banned

    Messages:
    2,633
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #6
    No, I have image verification in the submission form, and looks like this is a virus.

    Does any other directory owners have the same problem?
     
    hhheng, May 22, 2007 IP
  7. post12345

    post12345 Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    what is textarea? pls explain
     
    post12345, May 22, 2007 IP
  8. manilodisan

    manilodisan Peon

    Messages:
    224
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    the place where you wrote this comment...that box is a textarea :))
     
    manilodisan, May 22, 2007 IP