<?php
   $ref=(@($_GET['id']));
/* Getting file name */
$filename = $ref.($_FILES['file']['name']);
 //$dat=$_POST['dat']; 
/* Location */
$location = "uploads/".$filename;
$uploadOk = 1;
  
if($uploadOk == 0){
   echo 0;
}else{
   /* Upload file */
   if(move_uploaded_file($_FILES['file']['tmp_name'], $location)){
      echo $filename;
   }else{
      echo 0;
   }
}
?>