Skip to content

Instantly share code, notes, and snippets.

@jlamim
Created June 21, 2016 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlamim/8cde60bf0f8fd0913147cceb5e494d0a to your computer and use it in GitHub Desktop.
Save jlamim/8cde60bf0f8fd0913147cceb5e494d0a to your computer and use it in GitHub Desktop.
Exemplo de código CSRF para controller e view no CodeIgniter
<?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