Skip to content

Instantly share code, notes, and snippets.

@YurePereira
Created September 1, 2016 19:34
Show Gist options
  • Select an option

  • Save YurePereira/c9103ff5263fcf6213f9cdb37fadf931 to your computer and use it in GitHub Desktop.

Select an option

Save YurePereira/c9103ff5263fcf6213f9cdb37fadf931 to your computer and use it in GitHub Desktop.
Codeigniter: Getting Codeigniter CSRF token without form_close()
<?php
//Example: 1:
$csrf_token_name = $this->security->get_csrf_token_name();
$get_csrf_hash = $this->security->get_csrf_hash();
?>
<input
type="hidden"
name="<?php echo $csrf_token_name; ?>"
value="<?php echo $get_csrf_hash; ?>">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment