2014-10-27 41 views
0

在填充视图中的输入并单击提交按钮后,如果使用Firefox,记录会保存得很好。CakePHP XAMPP Internet Explorer在10秒后失去会话

如果我足够快,IE也是一样。但是,当我等待10秒钟,POST数据似乎并没有达到控制器,我得到这个错误信息

Notice (8): Undefined index: Incident [APP\Controller\IncidentsController.php, line 91] 
Notice (8): Undefined index: Machine [APP\Controller\IncidentsController.php, line 93]Code 
Notice (8): Undefined index: Machine [APP\Controller\IncidentsController.php, line 94]Code 

$这个 - >请求 - >数据为空

这只有IE浏览器出现。

控制器的方法:

/** 
    * c_add method 
    * 
    * @return void 
    */ 
     public function c_add() { 
      if ($this->request->is('post')) { 
       $this->Incident->create(); 
       $machineId = $this->Incident->Machine->find('first', array('conditions' => array('Machine.name' => $this->request->data['Incident']['machine_id_scancode']))); 
       $this->Incident->set(array(
        'machine_id' => $machineId['Machine']['id'], 
        'costcenter_id' => $machineId['Machine']['costcenter_id'], 
        'inc_start' => date('Y-m-d H:i:s') 
       )); 
       if ($this->Incident->save($this->request->data)) { 
        $this->Session->setFlash(__('The incident has been saved.')); 
        return $this->redirect(array('action' => 'c_index')); 
       } else { 
        $this->Session->setFlash(__('The incident could not be saved. Please, try again.')); 
       } 
      } 
      $machines = $this->Incident->Machine->find('list'); 
      $products = $this->Incident->Product->find('list'); 
      $incidentClasses = $this->Incident->IncidentClass->find('list'); 
      $costcenters = $this->Incident->Costcenter->find('list'); 
      $problemTypes = $this->Incident->ProblemType->find('list'); 
      $problemCauses = $this->Incident->ProblemCause->find('list'); 
      $specialists = $this->Incident->Specialist->find('list'); 
      $this->set(compact('machines', 'products', 'incidentClasses', 'costcenters', 'problemTypes', 'problemCauses', 'specialists')); 
     } 

查看:

<?php $this->extend('/Common/customer'); ?> 
<div class="incidents form"> 
<?php echo $this->Form->create('Incident'); ?> 
    <fieldset> 
     <legend><?php echo __('Add Incident'); ?></legend> 
     <table> 
      <tr> 
       <td><?php echo $this->Form->input('machine_id_scancode'); ?></td> 
       <td><?php echo(__('</br>Choose Machine by starting to type and pick one from the list. </br> If your machine is not on the list, pick the "Common" entry for your Team, e.g. "Allgemein PPT"')); ?></td> 
      </tr> 
      <tr> 
       <td><?php echo $this->Form->input('customer_email'); ?></td> 
       <td><?php echo(__('</br><p id="emailDescription">Email adress for job progress notification. Change as you like.</p>')); ?></td> 
      </tr> 
      <tr> 
       <td><?php echo $this->Form->input('inc_desc'); ?></td> 
       <td><?php echo(__('Please describe what should be done.')); ?></td> 
      </tr> 
      <tr> 
       <td><?php echo $this->Form->input('product_id', array('empty' => true)); ?></td> 
       <td><?php echo(__('Optional: Choose which product is affected.')); ?></td> 
      </td> 
     </table> 
    </fieldset> 
<?php echo $this->Form->end(__('Submit')); ?> 
</div> 
<script> 
$(function() { 
    $("#IncidentMachineIdScancode").autocomplete({ 
     source: "/stoerungen/machines/index.json" 
    }); 
}); 
$(document).ready(function() { 
    $.ajaxSetup({cache: false}); 
    if (navigator.userAgent.match(/msie/i)){ 
     $.get("../get_email.php", function(data){ 
      $("#IncidentCustomerEmail").val(data.email); 
      console.log("Got user's email Adress => " + data.email); 
     }, "json"); 
    } else{ 
     $("#emailDescription").text('No IE, please fill your email manually'); 
     console.log('no IE') 
    } 
}); 
</script> 

任何意见,帮助追查原因是高度赞赏。 预先感谢您!

回答

0

我将网络服务器从xampp的Apache更改为IIS。 问题在那里没有发生。