PHP upload script. I am able to statically change the $target_path so that the uploads are sent to a different bzp folder. When I try to get an id from the flash index page URL such as ?id=11, the id is blank. Any ideas?
Code:<?php set_time_limit ( 240 ) ; //BlueZone $bzp_id="11"; // This Works //$bzp_id = htmlspecialchars($_GET['id']); //This doesn't work //BlueZone $file=$_FILES['Filedata']; for($k=0;$k<count($file['name']);$k++){ $target_path = "bzp".$bzp_id."/"; //$target_path = "bzp11/"; $target_path = $target_path . basename( $file['name'][$k]); $orig=$target_path; $info = pathinfo($target_path); $ctr=1; while(file_exists($target_path)){ $target_path=$info['dirname']."/".$info['filename'].$ctr.".jpg";//.$info['extension']; $ctr++; } if(move_uploaded_file($file['tmp_name'][$k], $target_path)) { // echo "status=1&filepath=$target_path&size=".$file['size']; } else{ // echo "status=0&msg=Error"; } } echo "status=1"; ?>




Reply With Quote