Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Meta refresh issues need urgent help!!

    Hi guys,

    Just wanted to know is there any possible way to stop people posting meta refresh tags from a form in my site?? The site itself is an online game, and im currently getting idiots from all sorts of places posting refresh tags to there sites, now its easy to remove them but i want to stop them permanantly is there a code i can use to stop them being posted???? please help

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Quote Originally Posted by bobbynomates View Post
    Hi guys,

    Just wanted to know is there any possible way to stop people posting meta refresh tags from a form in my site?? The site itself is an online game, and im currently getting idiots from all sorts of places posting refresh tags to there sites, now its easy to remove them but i want to stop them permanantly is there a code i can use to stop them being posted???? please help
    The exact solution depends on how your page works. If it's PHP-based, which it most likely is, just use the htmlspecialchars() function to strip them down to encoded text (so for example instead of the user getting to post the character "<" it would post the encoded string for that character, which is "&lt;" -- htmlspecialchars does this for all html special characters so that no HTML code entered by your user is parsed by the browser).
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Use strip_tags(), if don't want to allow people for posting any html content.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #4
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Quote Originally Posted by abduraooft View Post
    Use strip_tags(), if don't want to allow people for posting any html content.
    That would keep legitimate users from entering certain characters even in appropriate ways ("<" and ">" come to mind). Depending on the OP's needs this might be overkill. Instead, htmlspecialchars would still include those restricted characters, but would just encode them so they are viewable but not parsed.

    Then again, if we're only concerned about meta refresh tags then a regular expression search and replace of the post might prove to be the most useful option of all.

    But we still don't know yet if OP is even using PHP...
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting


  •  

    Tags for this Thread

    Posting Permissions

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