http://blueimp.github.com/jQuery-File-Upload/
顺序:
在我使用的这个文件 uploader 中,我想使用 $_GET['id'] 请求传递一个值,如下所示:
问题:
$_GET['id']=2 无法在 upload_class.php 或 index.php 文件夹内读取/服务器/php/。从程序中读取 $_GET['id'] 值的最佳方法是什么?
熟悉该程序的人可以帮助我吗?提前致谢 ...
最佳答案
您可以通过上传图像时发布的表单发送数据。
有两种方法可以做到这一点。获取或发布数据。
<小时/>获取
更改表单的 action
属性以包含附加参数:
<form action="blueimp/php/index.php?id=2" method="post" enctype="multipart/form-data">
通过以下方式访问index.php中的变量:
$id = $_GET['id'];
<小时/>
发布
向表单添加一个输入字段,其中包含您想要传递的值:
<form action="blueimp/php/index.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" value="2" />
<div style="float:left;">
<label class="fileinput-button">
<span>Add Images</span>
<input id="fileSelector" type="file" name="files[]" multiple>
</label>
<button type="button" class="delete">Delete Selected</button>
<button type="button" class="checkAll">Check All</button>
</div>
</form>
通过以下方式访问index.php中的变量:
$id = $_POST['id'];
关于php - 如何在blueimp文件 uploader 中传递值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12718842/