Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php CodeIgniter表单仅发布隐藏字段_Php_Forms_Codeigniter_Input_Field - Fatal编程技术网

Php CodeIgniter表单仅发布隐藏字段

Php CodeIgniter表单仅发布隐藏字段,php,forms,codeigniter,input,field,Php,Forms,Codeigniter,Input,Field,我有一个CodeIgniter表单,它只提交隐藏的表单字段,而不是文本输入和文本区域 表格: <form action="/test.php" method="post" id="add_greeting_form" name="add_greeting_form"> <label for="greeting_caption">Your caption:</label> <textarea id="greeting_caption" r

我有一个CodeIgniter表单,它只提交隐藏的表单字段,而不是文本输入和文本区域

表格:

<form action="/test.php" method="post" id="add_greeting_form" name="add_greeting_form">

    <label for="greeting_caption">Your caption:</label>
    <textarea id="greeting_caption" rows="3" cols="40" name="greeting_caption"></textarea>

    <label for="greeting_name">Created by:</label>
    <input name="greeting_name" id="greeting_name" type="text" size="16" maxlength="32" value="<?php echo $url_name; ?>">

    <label for="greeting_company">Company:</label>
    <input name="greeting_company" id="greeting_company" type="text" size="16" maxlength="32">

    <input type="hidden" name="json_decorations" id="json_decorations" value="" autocomplete="off">
    <input type="hidden" name="greeting_background" id="greeting_background" value="ninth_street" required>
    <input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>">

    <button type="submit">Add</button>
</form>

您的说明:
创建人:
test.php的输出;仅显示隐藏表单字段的POST数据(json_装饰和问候语_背景):


当我使用$this->output->enable_profiler(TRUE)提交给控制器时,POST数据中只列出隐藏的表单字段

1)检查您发送的请求的外观(例如使用FireBug)-如果缺少变量,这意味着某些JS代码在提交之前正在对其进行剪切2)检查是否有任何
unset($\u POST[…
在PHP codeFireBug中只显示隐藏的输入。PHP中没有任何未设置的。我没有使用AJAX。如果关闭探查器并使用
echo'。打印($\u POST,true)。“”;
echo'。打印($this->input->POST(),true)“;”;
那么您是否得到相同的结果?嗯,为什么在隐藏字段上使用required?这没有意义。您使用的html版本是什么?使用输入类型submit而不是按钮类型submit不正确?您可能遇到了以下问题:
<?php
foreach ($_POST as $key => $value){
    echo $key.' = '.$value.'<br />';
}

// produces
// json_decorations = {"images":    [{"id":"big_house","src":"/images/2013/houses/townhouse.png","width":144,"height":323,"top":270,"left":566,"rotation":0},{"id":"clone_1","src":"/images/2013/decorations/cat.png","width":113,"height":86,"top":355,"left":374,"rotation":0}]}
// greeting_background = ninth_street
// csrf_test_name = 3c99b581bac9f07ba47ed7438b240b2b

?>