PHP code example of treehousetim / xcsrf
1. Go to this page and download the library: Download treehousetim/xcsrf 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/ */
treehousetim / xcsrf example snippets
namespace App\Controllers;
use treehousetim\xcsrf\xcsrf;
if( $_POST )
{
xcsrf::getInstance()->protect();
// process POST request here.
}
echo '<form>';
echo '<input type="hidden" value="' . xcsrf::getInstance()->getCode() . '"></input>';
echo '<input type="submit" value="Submit"></input>';
echo '</form>';