이 스크립트에 문제가 있습니다. 헤더 리다이렉트는 호출되지 않지만 MySQL 쿼리는 않습니다.json이 PHP 헤더를 호출했습니다.
MySQL 쿼리가 호출되고 헤더가 이상하지 않으므로 이상하게 보입니다. 난 당신이 다른 페이지로 호출 클라이언트를 리디렉션 할 있으리라 믿고있어 PHP 스크립트
$(function(){
var dropbox = $('#dropbox'),
message = $('.message', dropbox);
dropbox.filedrop({
// The name of the $_FILES entry:
paramname:'pic',
maxfiles: 1,
maxfilesize: 25,
url: 'upload.php',
uploadFinished:function(i,file,response){
$.data(file).addClass('done');
// response is the JSON object that upload.php returns
},
error: function(err, file) {
switch(err) {
case 'BrowserNotSupported':
showMessage('Your browser does not support HTML5 file uploads!');
break;
case 'TooManyFiles':
alert('Too many files! Only one at same time is allowed.');
break;
case 'FileTooLarge':
alert(file.name+' is too large! Please upload files up to 25mb.');
break;
default:
break;
}
},
// Called before each upload is started
beforeEach: function(file) {
if(!file.type.match(/^image\//)) {
alert('Only images are allowed!');
// Returning false will cause the
// file to be rejected
return false;
}
}
});
});
'AJAX'로 업로드하는 경우 리디렉션하지 않아야합니다. –
이 http://pastebin.com/yyfddgD5는 전체 스크립트이며, jQuery.filedrop.js도 사용하고 있습니다. –
헤더가 호출되지 않는다고 어떻게 말할 수 있습니까? MySQL 쿼리에 오류가 있거나 무엇 때문에? - 좋아, 일하지 말라 = 질문이 아니야. 코드 옆에 아무 것도 제공 할 수없는 경우를 제외하고는 닫을 투표를 할 것입니다. – hakre