jQuery response is text string. How do I make this a PHP variable?
I am using a file upload utility that renames files on the backend, then I use a jQuery script to append the file path to a div.
'onComplete': function(event, queueID, fileObj, response, data) {
$('#filesUploaded').append(''+response+'');
}
I want to take this response and turn it into a PHP variable that I can use with a form submission. Any assistance is greatly apprecia开发者_JAVA技巧ted.
The only way that I could see you could accomplish this is to create a session-level variable on the page that accepts the file upload. While php can create javascript variables (through scriptlets), the opposite is impossible.
OK, I got this working. Thanks for everyones help. Here's the code added to a hidden field called filesUploaded:
'onComplete': function(event, queueID, fileObj, response, data) {
$('#filesUploaded').attr('value', ''+response+'');
精彩评论