Tag Archives

2 Articles

Prevent CSRF-attacks in your PHP files using tokens

If you do not know how a CSRF-attack work, read here

This is a simple class for taking care of generating and validating the tokens.

Let’s say that you have login.php in which a form with two text fields and a submission button are included. What you want to do here is to generate an access token and apply it to the login form as a hidden value.

To validate the token, apply the code below in the file where the login form has been posted to.

Generating Bootstrap 3’s carousel made easy with PHP

1.Just link Bootstrap 3’s css & js files.

2.In your PHP file just.

3.To create the carousel…

The code can be found on github