Skip to content

Instantly share code, notes, and snippets.

@wmandai
wmandai / codeigniter-csrf
Created January 4, 2014 12:15
Codeigniter disable CSRF in specific pages
<?php
// Add this to your config.php file
if (stripos($_SERVER["REQUEST_URI"],'/controller/method') === FALSE) {
$config['csrf_protection'] = TRUE;
}else{
$config['csrf_protection'] = FALSE;
}
//the rest of the code