Download the PHP package modulework/csrfwork without Composer
On this page you can find all versions of the php package modulework/csrfwork. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download modulework/csrfwork
More information about modulework/csrfwork
Files in modulework/csrfwork
Download modulework/csrfwork
More information about modulework/csrfwork
Files in modulework/csrfwork
Vendor modulework
Package csrfwork
Short Description A simple way of protecting forms regarding to CSRF
License Apache 2.0
Package csrfwork
Short Description A simple way of protecting forms regarding to CSRF
License Apache 2.0
Please rate this library. Is it a good library?
Informations about the package csrfwork
CSRFWork
A simple way of protecting forms regarding to CSRF
Installation:
- Place the csrf.php file into your application folder
-
Include it
- and initate it:
HowTo
There are 2 methods available for you to interact with your cache.
TOKEN
token()
This method will return the token for the current and next request.
Example usage:
<input type="hidden" value="" name="csrf_token" />
This will add a hidden input field to you form with the name and the value is the token itself. How we can use we' ll see in the part.
CHECK
check($token)
This method will check if a string matches the token generated in the previous request.
- : string: the string to check
Example usage:
if (CSRF::check($_POST['csrf_token'])) {
// Everything' s fine
} else {
// The post request was not submited by the form on your site.
die('DIE STUPID ATTACKER'); //Take 'em down...
}
You can always have a look at the PHP doc for a brief explanation.
All versions of csrfwork with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.0
The package modulework/csrfwork contains the following files
Loading the files please wait ....