diff --git a/README.md b/README.md index ff166a4..1a1c8c4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,34 @@ # PHP-Block-CSRF -Secures requests and blocks CSRF attempts. + +## Requirements +PHP version 5.x (+) is required for running this. + +## Features +- Block CSRF Attempt. + +## Integration (PHP side) #1 +```php +require_once('CSRF.php'); +$CSRF = new CSRF(); + +if(isset($_POST['submit'])){ + switch($CSRF->checkToken($_POST['token'])){ + case false: + /* Your code, if the token is bad. */ + echo "Request denied."; + break; + default: + /* Your code, if the token is valid. */ + echo "Request allowed."; + break; + } +} +``` + +## Integration (HTML side) #2 +```html +
+ + +
+```