gpt4 book ai didi

php - 使用多个上传按钮

转载 作者:搜寻专家 更新时间:2023-10-31 22:05:30 25 4
gpt4 key购买 nike

我有一个包含 4 个上传按钮的页面。当谈到 4 个上传按钮时,我放了 4 个这样的脚本:

    $(function() {
$('#file_upload').uploadify({
'formData' : {
'PHPSESSID': '<?=session_id()?>',
'timestamp' : '<?php echo $timestamp;?>',
'token' : '<?php echo md5('unique_salt' . $timestamp);?>'
},
'swf' : 'uploadify.swf',
'uploader' : 'uploadify.php?id=<? echo $resID; ?>&state=<? echo strtolower($negeri); ?>',
'onQueueComplete': function() {
setTimeout(function(){location.reload(true);},100)
}

});
$('#file_upload1').uploadify({
'formData' : {
'PHPSESSID': '<?=session_id()?>',
'timestamp' : '<?php echo $timestamp;?>',
'token' : '<?php echo md5('unique_salt' . $timestamp);?>'
},
'swf' : 'uploadify.swf',
'uploader' : 'uploadify1.php?id=<? echo $resID; ?>&state=<? echo strtolower($negeri); ?>',
'onQueueComplete': function() {
setTimeout(function(){location.reload(true);},100)
}

});
$('#file_upload2').uploadify({
'formData' : {
'PHPSESSID': '<?=session_id()?>',
'timestamp' : '<?php echo $timestamp;?>',
'token' : '<?php echo md5('unique_salt' . $timestamp);?>'
},
'swf' : 'uploadify.swf',
'uploader' : 'uploadify2.php?id=<? echo $resID; ?>&state=<? echo strtolower($negeri); ?>',
'onQueueComplete': function() {
setTimeout(function(){location.reload(true);},100)
}

});
$('#file_upload3').uploadify({
'formData' : {
'PHPSESSID': '<?=session_id()?>',
'timestamp' : '<?php echo $timestamp;?>',
'token' : '<?php echo md5('unique_salt' . $timestamp);?>'
},
'swf' : 'uploadify.swf',
'uploader' : 'uploadify3.php?id=<? echo $resID; ?>&state=<? echo strtolower($negeri); ?>',
'onQueueComplete': function() {
setTimeout(function(){location.reload(true);},100)
}

});
});

问题它破坏了我所有的 session 。但是当我只放置一个脚本时。它不会破坏我的 session 。

有什么办法可以解决吗?

最佳答案

你可以这样使用

$('#file_upload,#file_upload1, #file_upload2,#file_upload3').uploadify({
'formData' : {
'PHPSESSID': '<?=session_id()?>',
'timestamp' : '<?php echo $timestamp;?>',
'token' : '<?php echo md5('unique_salt' . $timestamp);?>'
},
'swf' : 'uploadify.swf',
'uploader' : 'uploadify2.php?id=<? echo $resID; ?>&state=<? echo strtolower($negeri); ?>',
'onQueueComplete': function() {
setTimeout(function(){location.reload(true);},100)
}

});

关于php - 使用多个上传按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19330787/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com