Magic Methods in PHP

What are PHP Magic Methods?

PHP Magic methods are a specialized method that is executed in response to a specific event. Each magic methods start with two underscores(__) and it is called automatically when a certain condition is met. It triggers custom behaviors defined by a programmer inside the class. Some of the magic methods are __construct(), __destruct(),  __toString(),  __get(),  __set(), __call() etc.

In this tutorial, we are going to explore php magic methods.

PHP Magic Methods

PHP Magic Methods

Cross Site Scripting (XSS) Examples, Tutorials – How to Prevent In PHP

What is Cross Site Scripting (XSS). How to prevent this vulnerability in code.

XSS commonly known as cross-site scripting is a code injection technique or attack. In XSS user can inject any malicious HTML, Javascript or any other client side snippet on a web application. It is one of the major security attack after Sql Injection.