<?php	
session_start();
session_register("music_list");
foreach($_POST[checkbox] as $key=>$value){  //以book数组做循环，输出键和值
	if($_SESSION["music_list"]==""){
		$_SESSION["music_list"]=$value."@";
	}else{
    	$array=explode("@",$_SESSION["music_list"]);
		if(in_array($_GET["id"],$array)){
	   		echo "<script>alert('播放列表中已经存在此音乐！');history.back();</script>";
	   		exit;
		}
    $_SESSION["music_list"].=$value."@";
}
echo "<script>window.location.href='music_list.php';</script>";
?>