嗨,我的音乐歌曲网站有问题。我正在从我的电脑上传一首 mp3 歌曲并想在我的网站上播放它。但是不知道为什么mp3文件名没有出现在播放器src属性中。
有人可以帮助我吗?
<body>
<div id="main_container">
<form method="post" action='exercice.php' id="form1">
<input type="file" name="files" id="files" onChange="submitForm();">
</form>
<?php
if (isset($_FILES['files'])){
move_uploaded_file($_FILES['files']['tmp_name'], "uploaded/");
}
$src = isset($_FILES['files']['name'])?$_POST['files']['name']:'';
?>
<object id="MediaPlayer1" width="800" height="500" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject">
<param id="fileName" name="FileName" value='uploaded/<?php echo $src; ?>' />
<param name="AutoStart" value="false" />
<param name="DefaultFrame" value="mainFrame" />
<param name="ShowStatusBar" value="0" />
<param name="ShowPositionControls" value="0" />
<param name="showcontrols" value="0" />
<param name="ShowAudioControls" value="0" />
<param name="ShowTracker" value="0" />
<param name="EnablePositionControls" value="0" />
<!-- BEGIN PLUG-IN HTML FOR FIREFOX-->
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
src='uploaded/<?php echo $src; ?>' align="middle" width="800" height="500" defaultframe="rightFrame"
id="MediaPlayer2" />
</object>
</div>
</body>
</html>