Created
June 21, 2016 13:08
-
-
Save jlamim/8cde60bf0f8fd0913147cceb5e494d0a to your computer and use it in GitHub Desktop.
Exemplo de código CSRF para controller e view no CodeIgniter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Código do Controller | |
*/ | |
$csrf = array( | |
'nome' => $this->security->get_csrf_token_name(), | |
'hash' => $this->security->get_csrf_hash() | |
); | |
?> | |
<!-- Código da View --> | |
<input type="hidden" name="<?=$csrf['nome'];?>" value="<?=$csrf['hash'];?>" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment