建站极客
网络编程 PHP编程 正文
PHP实现网上点歌(二)
所属分类:
网络编程 / PHP编程
阅读数:
1622
收藏 0
赞 0
分享
midif2.php <? $d=dir("./dir"); //得到dir目录对象 $i="0"; while($entry=$d->read()){ $i=$i+1; if($i>2){ //大于2的目的是去掉当前目录的".",和表示前一个目录的".." $wq[]=$entry; //把目录明细放入$wq数组中 } } $d->close(); //关闭 ?> <html> <head> <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); //得到每一个dir目录下的每一个目录对象 $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> </head> <body> <form method="post" action="midif1.php" name="myform" target="f1"> <select name="zj" onChange="changelocation(document.myform.zj.options[document.myform.zj.selectedIndex].value)"> <?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="播放"> <input type="button" name="stop" value="停止" onclick="javascript:parent.f1.location.href='midif1.php'"> <br> <br> 播放次数: <select name="looptime"> <option value="1" selected>只听一遍</option> <option value="infinite">百听不厌</option> </select> <a href="javascript:history.go(0)">刷新曲目</a> </form> <script LANGUAGE="javascript"> <!-- changelocation(document.myform.zj.options[document.myform.zj.selectedIndex].value); //--> </script> </body> </html> 【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】
两种php去除二维数组的重复项方法 这篇文章主要介绍了两种php去除二维数组的重复项方法,大家可以进行比较看哪一种更适合自己,需要的朋友可以参考下
评论 0
收藏 0
赞 0
分享
php实现网站留言板功能 这篇文章主要介绍了php实现网站留言板功能,主要仿照了畅言留言板和网易跟帖样式进行制作,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
评论 0
收藏 0
赞 0
分享
PHP实现HTML页面静态化的方法 这篇文章主要介绍了PHP实现HTML页面静态化的方法,分享了静态处理的方法,静态处理后的优势,并提供了多种静态的方法,感兴趣的小伙伴们可以参考一下
评论 0
收藏 0
赞 0
分享
php对文件夹进行相关操作(遍历、计算大小) 这篇文章主要介绍了php对文件夹进行相关操作,包括遍历并打印指定目录下所有文件和计算文件大小去空白,以及去重复值等,感兴趣的小伙伴们可以参考一下
评论 0
收藏 0
赞 0
分享
非常全面的php日期时间运算汇总 这篇文章主要整理了关于php日期时间运算相关内容,涉及知识点较为全面,感兴趣的小伙伴们可以参考一下
评论 0
收藏 0
赞 0
分享
php根据用户语言跳转相应网页 这篇文章主要介绍了php根据用户语言跳转相应网页的方法,主要区分国内国外,感兴趣的小伙伴们可以参考一下
评论 0
收藏 0
赞 0
分享
双冒号 ::在PHP中的使用情况 前几天在百度知道里面看到有人问PHP中双冒号::的用法,当时给他的回答比较简洁因为手机打字不大方便!今天突然想起来,所以在这里总结一下我遇到的双冒号::在PHP中使用的情况
评论 0
收藏 0
赞 0
分享
查看更多