开发者

CodeIgniter how to get hidden field value using form_open_multipart()?

开发者 https://www.devze.com 2023-04-01 02:32 出处:网络
I am creating a web application that allows user to insert item data into database.insert_item page is just a regular HTML form.When user submits, the controller inserts item data into Item table, and

I am creating a web application that allows user to insert item data into database. insert_item page is just a regular HTML form. When user submits, the controller inserts item data into Item table, and then redirects user to insert_image page. In this page, I have a hidden fi开发者_C百科eld that contains the item_id (primary key for Item table). This page contains upload file form.

echo form_open_multipart('administration/validate_add_images');
form_hidden('id', $id);
$this->table->add_row(array(form_upload('uploads')));
form_submit('submit', 'Upload Images');

I can't get the value of id when user submits. My question: Is it possible to get the hidden field value using form_open_multipart()?


you should be able to access it just like any other form field

$this->input->post('id');


you can also get to display all your POST ARRAY like this

$this->input->post(NULL, TRUE);
0

精彩评论

暂无评论...
验证码 换一张
取 消