treehousetim/xcsrf
A library to enable simple cross site request forgery blocking
Installing
composer require treehousetim/xcsrf
Using
<?php 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>';On this page
Languages
PHP100.0%
Contributors
Latest Release
0.0.1February 21, 2022MIT License
Created February 21, 2022
Updated February 21, 2022