twilightnights Posted January 30, 2007 Share Posted January 30, 2007 I have a site that has users submit information which will displayed on a site, but I want to prevent them from posting html code, mainly <img src="blah.jpg"> so that they don't link nasty pictures or anything. Is there an easy way to avoid that? Link to comment https://forums.phpfreaks.com/topic/36260-solved-easiest-way-to-prevent-html-input-on-form/ Share on other sites More sharing options...
Jessica Posted January 30, 2007 Share Posted January 30, 2007 strip_tags() Link to comment https://forums.phpfreaks.com/topic/36260-solved-easiest-way-to-prevent-html-input-on-form/#findComment-172387 Share on other sites More sharing options...
HuggieBear Posted January 30, 2007 Share Posted January 30, 2007 PHP has a few built in functions for this kind of thing, and there's also regular expressions. Check the php manual for [url=http://uk.php.net/manual/en/function.strip-tags.php]strip_tags()[/url].RegardsHuggie Link to comment https://forums.phpfreaks.com/topic/36260-solved-easiest-way-to-prevent-html-input-on-form/#findComment-172388 Share on other sites More sharing options...
twilightnights Posted January 30, 2007 Author Share Posted January 30, 2007 Cool, ty. Link to comment https://forums.phpfreaks.com/topic/36260-solved-easiest-way-to-prevent-html-input-on-form/#findComment-172394 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.