Thy Gamer Posted March 29, 2006 Share Posted March 29, 2006 Is there any way I can strip html with out useing, strip_tags($tempinput) ???It messes up my code for some odd reason,[code]<?php$tempinput = "LOL PANTS javascript SELECT * FROM";SafeGurad($tempinput);function SafeGurad($tempinput) {$tempinput = strip_tags($tempinput)$tempinput = str_replace("%20","","$tempinput");$tempinput = addslashes("$tempinput");$tempinput = str_replace("javascript","No_Java_Script_Aloud!","$tempinput");$tempinput = str_replace("</script>","No_Script_Aloud!","$tempinput");$tempinput = str_replace("<script>","No_Script_Aloud!","$tempinput");$tempinput = str_replace("SELECT * FROM","No_SQL_Script_Aloud!","$tempinput");return $tempinput;}Echo $lol;php?>[/code] Link to comment https://forums.phpfreaks.com/topic/6130-striping-html/ Share on other sites More sharing options...
Cojawfee Posted March 29, 2006 Share Posted March 29, 2006 If you really hate strip_tags(), you could replace < and > with <'s and >'s. This stops any scripts from running, and any markup from rendering, but doesn't change the appearance. Link to comment https://forums.phpfreaks.com/topic/6130-striping-html/#findComment-22115 Share on other sites More sharing options...
Thy Gamer Posted March 31, 2006 Author Share Posted March 31, 2006 [!--quoteo(post=359831:date=Mar 29 2006, 04:53 PM:name=Cojawfee)--][div class=\'quotetop\']QUOTE(Cojawfee @ Mar 29 2006, 04:53 PM) [snapback]359831[/snapback][/div][div class=\'quotemain\'][!--quotec--]If you really hate strip_tags(), you could replace < and > with <'s and >'s. This stops any scripts from running, and any markup from rendering, but doesn't change the appearance.[/quote]So something like this?[code]$tempinput = str_replace("<","<","$tempinput");$tempinput = str_replace(">",">","$tempinput");[/code] Link to comment https://forums.phpfreaks.com/topic/6130-striping-html/#findComment-22488 Share on other sites More sharing options...
Prismatic Posted March 31, 2006 Share Posted March 31, 2006 [!--quoteo(post=360209:date=Mar 30 2006, 07:27 PM:name=Thy Gamer)--][div class=\'quotetop\']QUOTE(Thy Gamer @ Mar 30 2006, 07:27 PM) [snapback]360209[/snapback][/div][div class=\'quotemain\'][!--quotec--]So something like this?[code]$tempinput = str_replace("<","<","$tempinput");$tempinput = str_replace(">",">","$tempinput");[/code][/quote]Yep Link to comment https://forums.phpfreaks.com/topic/6130-striping-html/#findComment-22502 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.