Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

htmlspecialchars() tutotrial for beginners ~[Step by Step | Pictures]~

Have learned a good thing. Thanks for the share.
woow very good and detailed tutorial , many have knowledge leak when it comes to these stuff ...
I use htmlentities() myself but great tut anyway.
(Dec 24, 2012 08:27 PM)VoidEx. Wrote:  Yes this exactly.

However I myself do use htmlspecialchars when saving to db for certain things, such as usernames for my website. This is fine. Otherwise, parse on output is the recommended practice.

If you allow certain tags with htmlentities(), eg <b>, ensure that you are aware of the fact that people can still execute scripts.

Eg:
<b onload='alert(1)'></b>

To the OP:
Well done and thanks for the tutorial :) This should help a lot of people secure their websites.
I mostly add a number is `disallowed` words like javascript, onload, onerror ,document.cookie etc.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Node.JS] by VecturaAug 5, 2025 06:29 PM 3 127 Aug 5, 2025 06:29 PM
Last Post: HerrWinston
[PHP] by FiendJan 23, 2018 12:06 PM 3 127 Jan 23, 2018 12:06 PM
Last Post: Fiend
[PHP] by TRH4CKFeb 23, 2014 07:00 AM 4 195 Feb 23, 2014 07:00 AM
Last Post: MicroCoil