AngularJS非常新,我确信这很简单我做错了但我无法理解。 我要做的就是使用PHP从Angular登录传入的POST。 p>
AngularJS函数: p>
$ scope.addTask = function(){
$ http.post('process.php', {newTask:$ scope.newTask});
$ scope.newTask ='';
};
code> pre>
process.php: p> \ n
if(isset($ _ POST ['newTask'])){
createLog('test');
}
function createLog($ str){
$ file = 'log.txt';
$ str。=“
”;
file_put_contents($ file,$ str,FILE_APPEND | LOCK_EX);
}
code> pre>
div >