Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

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