我正在尝试在我的英特尔 XDK 项目中使用 codeigniter 来处理后端数据
我在 index.html 中有以下表格:
<form method="POST" class='ajax'>
<input type="text" name="user" />
<input type="password" name="password" />
<input type="submit" value="send" />
</form>
当我尝试使用我的 js 函数访问控制器时,我得到了找不到文件的状态:
$('form.ajax').on('submit', function(){
var that = $(this),
url = "../../controllers/welcome.php";
method = that.attr("method"),
data = {};
that.find("[name]").each(function(index, value){
var that = $(this),
name= that.attr("name");
value = that.val();
data[name] = value;
});
$.ajax({
url:url,
type:method,
data:data,
success: function(response){
console.log(response);
}
});
});
url 路径指向该文件,但它仍然显示状态为 404:localhost:58889/http-services/emulator-webserver/ripple/userapp//C/xampp/htdocs/my_project_folder/application/controllers/welcome.php
我是否必须在我的 htaccesses 和配置文件中设置一些东西,就像在网站中一样?
还有一件事,我的 XDK 项目位于应用程序内的视图文件夹中
提前致谢