开发者

jQuery response is text string. How do I make this a PHP variable?

开发者 https://www.devze.com 2023-01-31 14:45 出处:网络
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.

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+'');
0

精彩评论

暂无评论...
验证码 换一张
取 消