怎么在PHP网页上加入音乐播放代码啊
定义一个磁盘下的mp3文件路径,比如在d:/music下
读取文件大小
设置文件头的媒体类型
读取文件
<?php
$path="d://music/";
$filesize=filesize($path.$file_name);
header("Content-type:audio/mpeg");
header("Content-length:$filesize");
readfile($paht.$file_name);
?>
播放:
<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width=300 height=300 hspace="0" vspace="0" align="top" id="MediaPlayer1" style="LEFT: 0px; TOP: 0px">
<param name="_ExtentX" value="5556">
<param name="ShowStatusBar" value="-1">
<param name="_ExtentY" value="1588">
<param name="AUTOSTART" value="-1">
<param name="SHUFFLE" value="0">
<param name="PREFETCH" value="0">
<param name="NOLABELS" value="0">
<param name="SRC" value="fileselect?file=曹操.mp3">
<param name="CONTROLS" value="Imagewindow,StatusBar,ControlPanel">
<param name="CONSOLE" value="RAPLAYER">
<param name="LOOP" value="0">
<param name="NUMLOOP" value="0">
<param name="CENTER" value="0">
<param name="MAINTAINASPECT" value="0">
<param name="BACKGROUNDCOLOR" value="#000000">
</object>
<bgsound loop=#> #=循环数
例如:<bgsound src="sound.wav" loop=3>