Search code examples
phpcodeigniterform-helpers

How to convert form tag into form_open in codeigniter


How to write this code

<form action="http://<?php echo site_url();?>/loader/login_screen_flow" method="post" enctype="multipart/form-data" name="login_data"> 

to

<?form_open(........)?> 

format by using form helpers. Please help. Thanks.


Solution

  • Try this

    $attributes = array('name' => 'login_data');
    
    echo form_open_multipart('loader/login_screen_flowd', $attributes);
    

    Outputs

    <form method="post" accept-charset="utf-8" action="http:/example.com/index.php/loader/login_screen_flowd"  name="login_data" enctype="multipart/form-data"/>
    

    Load form helper as well $this->load->helper('form');