新手问题。我有一个网页发送$_POST数据到服务器上的php脚本。如何调试php (参见echo的输出)?如果我只是浏览www.serveradress.com/myscript.php,我什么也看不到...我使用的是Chrome。
谢谢
编辑:我在客户端使用ngFileUpload。编辑:我看到这个文件很受欢迎,因为我在服务器上用filezilla看到了它。
客户端:
代码语言:javascript运行复制$scope.uploadBoardPic = function(file, errFiles) {
$scope.boardPic = file;
$scope.errFile = errFiles && errFiles[0];
if (file) {
file.upload = Upload.upload({
url: 'http://myserver.com/angular-seed/appendBoardPicture.php',
method: 'POST',
data: {file: file}
});
file.upload.then(function (response) {
$timeout(function () {
file.result = response.data;
});
}, function (response) {
if (response.status > 0)
$scope.errorMsg = response.status + ': ' + response.data;
}, function (evt) {
file.progress = Math.min(100, parseInt(100.0 * evt.loaded / evt.total));
});
}
}服务器端:
代码语言:javascript运行复制
$filename = $_FILES['file']['name'];
$destination = './' . $filename;
move_uploaded_file( $_FILES['file']['tmp_name'] , $destination );
echo "
" . print_r($_FILES, true) . "";
?>