Devils666 Posted January 9, 2010 Report Share Posted January 9, 2010 (edited) īsti nezināju kā šo topiku nosaukt, bet nu, ideja tāda, piemēram iekš komentāra masīva ievada: blabla bla... <script>alert('lapa uzlausta')</script> HAHAHAHA Man vaig tādu ka replace funkciju, kas atrod iekš masīva tekstu <script> un </script> un pēc tam nodzēš arī to, kas pa vidu, jeb visu to <script>alert('lapa uzlausta')</script> lai pēc ievietoanas izskatīotos šādi: blabla bla... HAHAHAHA es zinu kā var atseviški to izdarīt $massiiivs = str_replace("<script>", '', $massiiivs); $massiiivs = str_replace("</script>", '', $massiiivs); bet man vaig lai ari nodzēstu to tekstu, kas ir pa vidu un arī vispārīgi kā izslēt html kodus Edited January 9, 2010 by Devils666 Quote Link to comment Share on other sites More sharing options...
false Posted January 9, 2010 Report Share Posted January 9, 2010 (edited) $teksts = htmlspecialchars("<script>alert("a");</script>", ENT_QUOTES); echo $teksts; Tad radīs tikai tekstu <script>alert("a");</script> Edited January 9, 2010 by false Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted January 9, 2010 Report Share Posted January 9, 2010 http://uk.php.net/manual/en/function.strip-tags.php Quote Link to comment Share on other sites More sharing options...
Devils666 Posted January 9, 2010 Author Report Share Posted January 9, 2010 paldies, izmantoju strip_tags un visus html kodus noņem, ideali :) Quote Link to comment 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.