<?
	$mId = $_POST['mId'];	//使用者帳號
	$seq = $_POST['seq'];
	require_once('link.php');
	mysql_select_db($database,$connect);
   
	if( ($_FILES['data']['error'][0] == UPLOAD_ERR_OK )) //如果有上傳,即處理
	{ 
		$userfile_1 = $_FILES['data']['tmp_name'][0]; //上傳圖檔(暫存位置)
        $upfile_1 = "./music/".$_FILES['data']['name'][0]; //檔案上傳後的位置+檔案名稱
          
        if( (move_uploaded_file($_FILES['data']['tmp_name'][0], $upfile_1)))
        {	
        	echo "UPLOAD DONE  " . $_FILES['data']['name'][0] ;
        }else{
			echo "UPLOAD FAIL 101 " ;
		}
	}else{
		echo "UPLOAD FAIL 102 " ;
	}
	$upfile_2 = "/music/".$_FILES['data']['name'][0];
	$content = addslashes(nl2br($content));
	$query1 = "INSERT INTO `Share` VALUES ('$mId','$seq',NOW(),'$bName','$song','$upfile_2')";
	mysql_query($query1,$connect);
?>
<script language="javascript">
	alert("上傳成功！");
	location.href="share.php";
</script>