Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/263.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.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调用后输出状态:303参见其他_Php_Forms_Codeigniter_Post_Codeigniter 3 - Fatal编程技术网

Php CodeIgniter调用后输出状态:303参见其他

Php CodeIgniter调用后输出状态:303参见其他,php,forms,codeigniter,post,codeigniter-3,Php,Forms,Codeigniter,Post,Codeigniter 3,过去3天,我一直试图在Codeigniter中进行POST调用,但无法获取POST数据 我最初使用的是表格式,但经过探索,我发现在CodeIgniter中从表中获取输入字段会带来很多错误。所以今天我试着用普通的输入元素。我仍然无法检索POST数据 形成的页面URL: 表格: <?= form_open('set-schedule') ?> <div class="form-group"> <label

过去3天,我一直试图在Codeigniter中进行POST调用,但无法获取POST数据

我最初使用的是表格式,但经过探索,我发现在CodeIgniter中从表中获取输入字段会带来很多错误。所以今天我试着用普通的输入元素。我仍然无法检索POST数据

形成的页面URL:

表格:

<?= form_open('set-schedule') ?>
              <div class="form-group">
                  <label>Select Date: </label>
                  <?php
                        $formData = "";
                        if(isset($_GET['date'])) {
                          $formData = $this->schedule_model->get_data($_GET['date']);
                          echo "<input type=\"text\" class=\"date-picker\" id=\"add_date\" value=" . $_GET['date'] ."></input>";
                        } else {
                          echo "<input type=\"text\" class=\"date-picker\" id=\"add_date\"></input>";
                        }
                  ?>
              </div>

                <div class="div-table">
                   <div class="div-table-row">
                      <div class="div-table-col heading" align="center">DATE</div>
                      <div  class="div-table-col heading">Head1</div>
                      <div  class="div-table-col heading">Head2</div>
                      <div  class="div-table-col heading">Head3</div>
                      <div  class="div-table-col heading">Head4</div>
                   </div>

                  <?php for ($row = 1; $row <= 7; $row ++) { ?>
                        <div class="div-table-row" id="form_data_custom">
                          <div class="div-table-col" align="center">
                            <?php echo "<input type='text' class='form-group' name='date_" . $row . "' placeholder='Enter DATE' readonly></input>"; ?>
                          </div>
                          <div class="div-table-col" align="center">
                            <?php echo "<input type='text' class='form-group' name='a_" . $row . "' placeholder='Enter Entry A'></input>"; ?>
                          </div>
                          <div class="div-table-col" align="center">
                            <?php echo "<input type='text' class='form-group' name='b_" . $row . "' placeholder='Enter Entry B'></input>"; ?>
                          </div>
                          <div class="div-table-col" align="center">
                            <?php echo "<input type='text'  class='form-group' name='c_" . $row . "' placeholder='Enter Entry C'></input>"; ?>
                          </div>
                          <div class="div-table-col" align="center">
                            <?php echo "<input type='text' class='form-group' name='d_" . $row . "' placeholder='Enter Entry D'></input>"; ?>
                          </div>
                        </div>
                  <?php } ?>

              </div>
              <div class="form-group text-right">
                <input type="submit" class="form-group btn btn-primary btn-sm" value="Submit"> Add/Update
                </input>
              </div>

            </form>
控制器(schedule.php):

将所有POST数据获取为NULL


请指导我可能出错的地方。谢谢

您试过这个吗:

使用这行代码

     public function set()
     {
        var_dump($this->input->post());
        /*--OR---*/
        var_dump($_REQUEST);
         /*--OR---*/
        print_r($this->input->post());
        die;
     }

我还可以看到chrome调试器中为post调用提交的数据,在“表单数据”下,您是否尝试过这样的打印($this->input->post());用这个代替为什么?
Hi pradeep有什么问题,print\r给出了相同的结果。在index.php顶部添加die(var_dump($_POST))时,我可以看到我的POST数据。但不是在controllerGetting empty:string(8)“HERE”数组(0){}数组(0){}数组()[]打印任何内容并在控制器中死亡以检查url是否正常工作这很奇怪。当我添加模具时,我现在可以看到数据了!这是为什么。这是否意味着我正在获取数据,但无法打印数据,您必须使用die来阻止对数据的进一步处理page@zeetit在所有输入字段中添加name属性以获取表单数据
    public function set()
    {
        var_dump('HERE');

        // create the data object
        $data = new stdClass();

        // load form helper and validation library
        $this->load->helper('form');
        $this->load->library('form_validation');


        $form_data = $this->input->post();
        echo json_encode($_POST);
        echo json_encode("----");
        echo json_encode($form_data);

        ........
}
     public function set()
     {
        var_dump($this->input->post());
        /*--OR---*/
        var_dump($_REQUEST);
         /*--OR---*/
        print_r($this->input->post());
        die;
     }