Results 1 to 7 of 7

Thread: [php] Stripping html characters

Hybrid View

  1. #1

    [php] Stripping html characters

    Hey everyone,
    I'm adding a comment form to my blog, but I don't want people to be able to break my blog by entering html or php or any other code. So I need to know if there is a function that converts special characters such as < or > or / etc. into their form that's like &whatever;
    I hope that made sense, I don't know the proper words for some of the things I was talking about so that might have been hard to follow.
    I guess if I really have to I can just do a str_replace on < and > but I'd like to know if there's a more effective way.

    Thanks

  2. #2
    4,029
    posts
    home cooking is killing the restaurant industry
    Quote Originally Posted by xxviii
    Hey everyone,
    I'm adding a comment form to my blog, but I don't want people to be able to break my blog by entering html or php or any other code. So I need to know if there is a function that converts special characters such as < or > or / etc. into their form that's like &whatever;
    I hope that made sense, I don't know the proper words for some of the things I was talking about so that might have been hard to follow.
    I guess if I really have to I can just do a str_replace on < and > but I'd like to know if there's a more effective way.

    Thanks
    http://php.net/htmlentities

    or maybe http://php.net/strip_tags might work as well..
    There are only 10 kinds of people in this world:
    Those that might know ternary, those that do, and those that don't
    Say NO to DRM.

  3. #3

  4. #4
    thank you very much both of y'all
    I'll check it out later tonigh

  5. #5

  6. #6
    thanks, I already got what I needed though. Thanks anyway though

  7. #7
    your welcome

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012