PHP code example of ahmetbarut / csrf

1. Go to this page and download the library: Download ahmetbarut/csrf library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ahmetbarut / csrf example snippets


    use ahmetbarut\Csrf\Csrf;

    token oluşturur. Herhangi bir istek yoksa üretilir, istek varsa token üretmez. 
    $csrf = new Csrf;

    // Üretilen token değerini getirir.
    $csrf->getToken();


    use ahmetbarut\Csrf\Csrf;

           $csrf->tokenHas($_POST); // bool
    }