• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What I must do to add "CSFR prevention field" to my forms?

#1
[eluser]frankabel[/eluser]
Hi,

In User Guide one can read

Quote:The first function is provided by the form helper and renders the form element and adds extra functionality, like adding a hidden CSFR prevention field. The latter is used to report errors related to form validation.

at http://ellislab.com/codeigniter/user-gui...items.html

My question is, what I must do to get the cited "CSFR prevention field" to my form? I uses "form_open()" function but not attribute or field is added to my form.

Thanks in advanced
Frank

#2
[eluser]daparky[/eluser]
You can enable csrf protection by opening your application/config/config.php file and setting this:

$config['csrf_protection'] = TRUE;
If you use the form helper the form_open() function will automatically insert a hidden csrf field in your forms.

#3
[eluser]skunkbad[/eluser]
If you plan to use ajax, you will need to get the value of that token and send it along with your ajax request.

#4
[eluser]frankabel[/eluser]
Thanks you all for your useful replies.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.