使用php GET数据为uploadify创建动态上传路径

I am writing an intranet customer manager (so will not be accessible at all from the internet, and runs locally only). I am using Uploadify http://www.uploadify.com/documentation/ , a Jquery script to add files to each of the customers records (its being used in a shop, so the shop keeper can add photos / measurement info for the customers carpets).

I am using the following settings in the head of my index.php to call the jquery uploader. What I cant work out is how to add a dynamic upload folder to it ?. What it needs to do is be :

'folder'    : './customer-files/<?php $_GET['cfid'] ?>',

Is it even possible to mix jquery and php like this ?, what its supposed to do is replace the cfid stored in GET with the actual id number of the customer, for example ./customer-files/22

<script type="text/javascript" src="./uploadify/swfobject.js"></script>
<script type="text/javascript" src="./uploadify/jquery.uploadify.v2.1.4.min.js">   </script>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function() {
  $('#customeraddnewfile').uploadify({
    'uploader'  : './uploadify/uploadify.swf',
    'script'    : './uploadify/uploadify.php',
    'cancelImg' : './uploadify/cancel.png',
    'folder'    : './customer-files',
   'auto'      : true
  });
});
// ]]>
</script>

Best way to do this is to pass through an extra parameter using scriptData (your customer ID, and probably some kind of security token that you can check) and then edit the PHP script to lookup the user, create a folder if it doesn't exist yet, then upload the file to that location. Bypassing the need to use the folder attribute.

<script type="text/javascript">
// <![CDATA[
$(document).ready(function() {
  $('#customeraddnewfile').uploadify({
    'uploader'  : './uploadify/uploadify.swf',
    'script'    : './uploadify/uploadify.php',
    'cancelImg' : './uploadify/cancel.png',
    'folder'    : './customer-files',
    'scriptData': {'cust_id':1234},
    'auto'      : true
  });
});
// ]]>
</script>

Without your PHP script I can't really help in more detailed terms.

Dont send your data using scriptData.you can use formData.