PHP to achieve online song (ii)

Source: Internet
Author: User
midif2.php
?
$d =dir ("./dir"); Get dir directory Object
$i = "0";
while ($entry = $d->read ()) {
$i = $i +1;
if ($i >2) {//greater than 2 is intended to remove the "." of the current directory and the "..." of the previous directory.
$WQ []= $entry; Put the catalog details into the $WQ array
}
}
$d->close (); Shut down
?>


<title>List</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<script language= "JavaScript" >
<!--
var Onecount;
onecount=0;
subcat = new Array ();
?
$onecount = "0";
for ($j =0; $j <count ($WQ); $j + +) {
$dir = "./dir/". $wq [$j];
$d =dir ($dir); Get every directory object in the Dir directory
$i = "0";
while ($entry = $d->read ()) {
$i = $i +1;
if ($i >2) {
?>
Subcat[<?echo $onecount;? = new Array ("<?echo $entry;? > "," <?echo $wq [$j];? > "," <?echo $entry;? > ");
?
$onecount = $onecount +1;
}
}
$d->close ();
}
?>
Onecount=<?echo $onecount;? >;

function Changelocation (LocationID)
{
document.myform.song.length = 0;
var Locationid=locationid;
var i;
For (I=0;i < onecount; i++)
{
if (subcat[i][1] = = LocationID)
{
Document.myform.song.options[document.myform.song.length] = new Option (subcat[i][0],subcat[i][2]);
}
}

}
-->
</script>

<body>
<form method= "POST" action= "midif1.php" name= "MyForm" target= "F1" >
<select name= "ZJ" >
<?for ($i =0; $i <count ($WQ); $i + +) {?>
<option value= "<?echo $wq [$i];? > "><?echo $wq [$i];? ></option>
?? >
</select>
<select name= "Song" >
<option selected Value= "" ></option>
</select>
<input type= "Submit" name= "Play" value= "playing" >
<input type= "button" name= "Stop" value= "stopped" >
<br>
<br>
Play Number:
<select name= "Looptime" >
<option value= "1" selected> just listen to it once </option>
<option value= "Infinite" > Hundred deaf </option>
</select>
<a href= "javascript:history.go (0)" > Refresh track </a>
</form>
<script language= "JavaScript" >
<!--
Changelocation (Document.myform.zj.options[document.myform.zj.selectedindex].value);
-->
</script>
</body>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.