• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i need to know the 2 kind of forms , which one is More functional ?

#1
i need to know the 2 kind of forms , which one is More functional ?

 1) <form></form> ,  

 2) <?php echo form_open(''); ?><?= [b]echo form_close();?>[/b]


again i need to ask which one is more functional , and i need input type date how to use it in 2nd one form ?
Reply

#2
The main difference between hard coding form tags and using built in form helpers is, form helpers will automatically escape special characters to display form value where you have to manually use "html_escape()" function to escape special characters.

Secondly, If you are more comfortable with PHP than hard coding HTML within PHP, then form helpers will help you generate custom forms.

You can always read the official documentation for further information.
Reply

#3
use form_open function mainly for the reason that has CSRF protection if you ever will need it.


https://www.codeigniter.com/user_guide/l...t=csrf#id2

if in future you will need to enable CSRF protection you won't have to change all hard coded <form> tags to form_open().

for the input/select fields I just hard code them.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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