xyn Posted October 6, 2006 Share Posted October 6, 2006 Hey Guys,Is there anyway of using PHP to check a "field" before it isentered into a database, then removing all HTML and Javascriptfrom that message?I was thinking of using str_replace.. but for that i would need tomannually add all the HTML codes i want to remove and loop allthe fields through arrays etc..Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/23171-strip-html-javascript/ Share on other sites More sharing options...
HuggieBear Posted October 6, 2006 Share Posted October 6, 2006 A Regular Expression is what you're after... Do a search in the Regular Expression forum on this board as I'm sure there's loads of instances of this very request.Huggie Quote Link to comment https://forums.phpfreaks.com/topic/23171-strip-html-javascript/#findComment-104960 Share on other sites More sharing options...
obsidian Posted October 6, 2006 Share Posted October 6, 2006 just use strip_tags() Quote Link to comment https://forums.phpfreaks.com/topic/23171-strip-html-javascript/#findComment-104970 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.