我的 codeigniter 视图文件中有以下几行 jquery 代码,它获取表单字段值并将它们发送到控制器中的add_emp_performance
函数。employees
var emp_id = "<?php echo $this->uri->segment(3); ?>";
var title = $("#title").val();
var date = $("#date").val();
var url = "<?php echo base_url().'index.php/employees/add_emp_performance/';?>"+emp_id;
//alert(emp_id); ---> works fine
//alert(url); ---> works fine
$.ajax({
type: "GET",
//type: "POST",
url: url,
//data: 'emp_id='+emp_id+'&title='+title+'&date='+date,
success: function(r){
if(r==1){
alert("Performance Saved!");
}else{
alert("Error!");
}
}
});
控制器员工函数 add_emp_performance :
function add_emp_performance($emp_id){
echo $emp_id ;exit;
我不断收到以下错误:
A PHP Error was encountered
Severity: Warning
Message: Missing argument 1 for Employees::add_emp_performance()
Filename: controllers/employees.php
可能是什么问题呢?多谢!