Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-18-2009, 03:08 PM   PM User | #1
bobbynomates
New to the CF scene

 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
bobbynomates is an unknown quantity at this point
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
bobbynomates is offline   Reply With Quote
Old 12-18-2009, 07:39 PM   PM User | #2
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
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
Rowsdower! is offline   Reply With Quote
Old 12-19-2009, 09:31 AM   PM User | #3
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Use strip_tags(), if don't want to allow people for posting any html content.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 12-19-2009, 12:23 PM   PM User | #4
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
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
Rowsdower! is offline   Reply With Quote
Reply

Bookmarks

Tags
html, meta, refresh

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:24 AM.


Advertisement
Log in to turn off these ads.