PHP实现网上点歌(二)
PHP 实现 网上
2023-06-13 09:13:44 时间
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>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<scriptLANGUAGE="javascript">
<!--
varonecount;
onecount=0;
subcat=newArray();
<?
$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;?>]=newArray("<?echo$entry;?>","<?echo$wq[$j];?>","<?echo$entry;?>");
<?
$onecount=$onecount+1;
}
}
$d->close();
}
?>
onecount=<?echo$onecount;?>;
functionchangelocation(locationid)
{
document.myform.song.length=0;
varlocationid=locationid;
vari;
for(i=0;i<onecount;i++)
{
if(subcat[i][1]==locationid)
{
document.myform.song.options[document.myform.song.length]=newOption(subcat[i][0],subcat[i][2]);
}
}
}
//-->
</script>
</head>
<body>
<formmethod="post"action="midif1.php"name="myform"target="f1">
<selectname="zj"onChange="changelocation(document.myform.zj.options[document.myform.zj.selectedIndex].value)">
<?for($i=0;$i<count($wq);$i++){?>
<optionvalue="<?echo$wq[$i];?>"><?echo$wq[$i];?></option>
<?}?>
</select>
<selectname="song">
<optionselectedvalue=""></option>
</select>
<inputtype="submit"name="play"value="播放">
<inputtype="button"name="stop"value="停止"onclick="javascript:parent.f1.location.href="midif1.php"">
<br>
<br>
播放次数:
<selectname="looptime">
<optionvalue="1"selected>只听一遍</option>
<optionvalue="infinite">百听不厌</option>
</select>
<ahref="javascript:history.go(0)">刷新曲目</a>
</form>
<scriptLANGUAGE="javascript">
<!--
changelocation(document.myform.zj.options[document.myform.zj.selectedIndex].value);
//-->
</script>
</body>
</html>
【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】
<?
$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>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<scriptLANGUAGE="javascript">
<!--
varonecount;
onecount=0;
subcat=newArray();
<?
$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;?>]=newArray("<?echo$entry;?>","<?echo$wq[$j];?>","<?echo$entry;?>");
<?
$onecount=$onecount+1;
}
}
$d->close();
}
?>
onecount=<?echo$onecount;?>;
functionchangelocation(locationid)
{
document.myform.song.length=0;
varlocationid=locationid;
vari;
for(i=0;i<onecount;i++)
{
if(subcat[i][1]==locationid)
{
document.myform.song.options[document.myform.song.length]=newOption(subcat[i][0],subcat[i][2]);
}
}
}
//-->
</script>
</head>
<body>
<formmethod="post"action="midif1.php"name="myform"target="f1">
<selectname="zj"onChange="changelocation(document.myform.zj.options[document.myform.zj.selectedIndex].value)">
<?for($i=0;$i<count($wq);$i++){?>
<optionvalue="<?echo$wq[$i];?>"><?echo$wq[$i];?></option>
<?}?>
</select>
<selectname="song">
<optionselectedvalue=""></option>
</select>
<inputtype="submit"name="play"value="播放">
<inputtype="button"name="stop"value="停止"onclick="javascript:parent.f1.location.href="midif1.php"">
<br>
<br>
播放次数:
<selectname="looptime">
<optionvalue="1"selected>只听一遍</option>
<optionvalue="infinite">百听不厌</option>
</select>
<ahref="javascript:history.go(0)">刷新曲目</a>
</form>
<scriptLANGUAGE="javascript">
<!--
changelocation(document.myform.zj.options[document.myform.zj.selectedIndex].value);
//-->
</script>
</body>
</html>
【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】
相关文章
- uni-app+php+workman实现简单聊天功能之交互实现(会话列表)
- PHP在MySQL中实现安全的表单提交(php表单提交mysql)
- 探索Linux下查看PHP扩展的奥秘(linux查看php扩展)
- Linux更新:升级PHP版本(linux更新php版本)
- PHP与Redis实现高性能并发处理(phpredis并发)
- MySQL登录安全之PHP实现(php登录mysql)
- 脚本Linux实现自动化执行PHP脚本(linux自动执行php)
- Linux搭建PHP网站实现快速上线(linux架设php网站)
- Linux下的PHP缓存技术实现(linuxphp缓存)
- PHP操作MySQL数据库实现排名(mysql排名php)
- 用Redis和PHP完成高效抢红包功能(redis抢红包php)
- PHP使用Redis实现数据存储(php连接redis)
- 用PHP操作Oracle:实现强大的数据库能力(php支持oracle)
- MySQL与PHP的连接:实现快速数据库访问(mysql连接php)
- 利用PHP实现MySQL数据库操作的简易指南(php实现mysql)
- 利用Redis和PHP实现高效数据处理(redis php 使用)
- PHP操作MSSQL——实现高效读写(php读写mssql)
- PHP实现从MSSQL中数据显示(php 显示 mssql)
- 使用PHP连接MSSQL数据库运行管道!(php mssql 管道)
- 仅用PHP操作MSSQL,实现快速下载!(php mssql下载)
- PHP环境下使用Redis实现单例模式(redisphp单例)
- PHP连接MSSQL 64位数据库的实现(php mssql 64)
- PHP实现稳定支持Redis的精彩瞬间(让php支持redis)
- Oracle和PHP完美配合提升数据库性能(oracle php配置)
- 需要使用php模板的朋友必看的很多个顶级PHP模板引擎比较分析
- 7个超级实用的PHP代码片段
- php中判断字符串是否全是中文或含有中文的实现代码
- PHP如何利用P3P实现跨域
- 实现Nginx中使用PHP-FPM时记录PHP错误日志的配置方法
- PHP实现文件下载详解
- php启用sphinx全文搜索的实现方法