Blogger Information
Blog 18
fans 0
comment 0
visits 20145
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
电影网站示例
葛佬的博客
Original
2597 people have browsed it

index:主页

list:分类页

details:详情页


1.jpg实例

<?php
    // 视频相关的 作为一个数组,二维数组
    $movies = [
            [
                // 视频ID
                    'mov_id'=>1,
                    'name'=>'倚天屠龙记',
                    'image'=>'1.jpg',
                    'detail'=>'元朝末年,群雄纷起,武林动荡。江湖传闻,得到屠龙刀倚天剑者,可以成为武林至尊,号令天下,莫敢不从。一时间风云四起,引发了武林中对屠龙刀倚天剑的争夺,几段姻缘和孽缘也由此产生。武当派张翠山与天鹰教殷素素…	',
                // 分类ID
                    'cate_id'=>1
            ],
            [
                    'mov_id'=>2,
                    'name'=>'都挺好',
                    'image'=>'2.jpg',
                    'detail'=>' 苏母的的突然离世打破了这个家庭外表的平静,意想不到的隐患层层显露,对毫无主见却又自私、小气的苏父的安置和后续生活问题,引发了远在国外的大哥与本城的二哥、小妹三家规律生活的不再。一直被苏母压制的苏父翻…	',
                    'cate_id'=>1
            ],
            [
                    'mov_id'=>3,
                    'name'=>'如果可以这样爱',
                    'image'=>'3.jpg',
                    'detail'=>'一对已婚男女突然徇情自杀,以为可以结束这一切,却不料悲剧才刚刚开始——他们的爱人,耿墨池和白考儿,同时在葬礼上邂逅。面对同样的背叛他们同时选择报复但又同时爱上彼此,注定饱受打击和折磨。然而他们想真心拥…	',
                    'cate_id'=>1
            ],
            [
                    'mov_id'=>4,
                    'name'=>'复仇者联盟4',
                    'image'=>'4.jpg',
                    'detail'=>'《复仇者联盟4:终局之战》将是漫威宇宙“无限传奇”(The Infinity Saga)的终结篇,是漫威电影宇宙十年的一个重要节点,结束部分英雄电影的故事,但也将展开新的剧情,呈现新的更为广阔宏大的宇…',
                    'cate_id'=>2
            ],
            [
                    'mov_id'=>5,
                    'name'=>'波西米亚狂想曲',
                    'image'=>'5.jpg',
                    'detail'=>'弗雷迪·默丘里成名前在机场做行李搬运工。有一天,默丘里毛遂自荐加入杰·泰勒与布莱恩·梅的乐团,恰巧当天原本的主唱辞职,默丘里用自己横跨四个八度的超广音域说服两人,从此开启皇后乐团的摇滚传奇!',
                    'cate_id'=>2
            ],
            [
                    'mov_id'=>6,
                    'name'=>'阿丽塔:战斗天使',
                    'image'=>'6.jpg',
                    'detail'=>'弗雷迪·默丘里成名前在机场做行李搬运工。有一天,默丘里毛遂自荐加入杰·泰勒与布莱恩·梅的乐团,恰巧当天原本的主唱辞职,默丘里用自己横跨四个八度的超广音域说服两人,从此开启皇后乐团的摇滚传奇!',
                    'cate_id'=>2
            ],
            [
                    'mov_id'=>7,
                    'name'=>'情书',
                    'image'=>'7.jpg',
                    'detail'=>'***神户某个飘雪的冬日,渡边博子(中山美穗)在前未婚夫藤井树的三周年祭日上又一次悲痛到不能自已。正因为无法抑制住对已逝恋人的思念,渡边博子在其中学同学录里发现“藤井树” 在小樽市读书时的地址时,依循着…',
                    'cate_id'=> 3
            ],
            [
                    'mov_id'=>8,
                    'name'=>'天空之城',
                    'image'=>'8.jpg',
                    'detail'=>'韩书珍将两个女儿的教育问题和对丈夫的贤内助工作都做得井井有条,在天空之城之中也是备受瞩目的女王,但其实书珍一直隐藏着不为人所知的秘密。李秀林是个充满了关怀和情感丰沛的童话作家,在书珍的引导之下成为了天…',
                    'cate_id'=>3
            ],
            [
                    'mov_id'=>9,
                    'name'=>'龙猫',
                    'image'=>'9.jpg',
                    'detail'=>'为了方便妻子草壁靖子养病,草壁达郎决定带着两个女儿草壁皋月和草壁米搬到草壁靖子所在疗养院附近的乡下,父女三人入住了一间年久失修的老房子。小姐妹俩很快发现看似平凡无奇的乡下有很多神奇的事物,无人居住的房…',
                    'cate_id'=>3
            ],
    ];

    // 栏目数组
    // 一维数组,无法进行跳转,所以使用二维数组
    $cates = [
            ['cate_id'=>1, 'name'=>'gc', 'alias'=>'国产好剧'],
            ['cate_id'=>2, 'name'=>'om', 'alias'=>'欧美猛片'],
            ['cate_id'=>3, 'name'=>'rh', 'alias'=>'日韩新片'],
    ];

//    评论内容
    $talks = [
            [
                    'talk_id' => 1,
                    'talk_info' => '评价1:倚天屠龙记倚天屠龙记倚天屠龙记',
                    'talk_time' => '2019-1-1',
                    'mov_id' => 1
            ],
            [
                    'talk_id' => 2,
                    'talk_info' => '评价2:倚天屠龙记倚天屠龙记倚天屠龙记',
                    'talk_time' => '2019-1-2',
                    'mov_id' => 1
            ],
            [
                    'talk_id' => 3,
                    'talk_info' => '评价3:倚天屠龙记倚天屠龙记倚天屠龙记',
                    'talk_time' => '2019-1-3',
                    'mov_id' => 1
            ],
            [
                    'talk_id' => 4,
                    'talk_info' => '评价1:都挺好都挺好都挺好',
                    'talk_time' => '2019-1-4',
                    'mov_id' => 2
            ],
            [
                    'talk_id' => 5,
                    'talk_info' => '评价1:如果可以这样爱如果可以这样爱如果可以这样爱',
                    'talk_time' => '2019-1-5',
                    'mov_id' => 3
            ],
            [
                    'talk_id' => 6,
                    'talk_info' => '评价2:如果可以这样爱',
                    'talk_time' => '2019-1-6',
                    'mov_id' => 3
            ]
    ];
    // 网站的系统设置,一维数组
    $system = [
            'sys_id'=>1,
            'title'=>'私人影院',
            'desc'=>'收集全网最新最全的影视资源',
            'key'=>'国产,欧美,日韩',
            'copy'=>'php中文网'
    ];
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="static/css/style.css">
    <meta name="description" content="<?php echo $system['desc'] ?>">
    <meta name="keywords" content="<?php echo $system['key'] ?>">
    <title><?php echo $system['title'] ?>index主页</title>
</head>
<body>
<!--头部导航-->
<div class="header">
    <ul class="nav">
        <li><a href="index.php">首页</a></li>
        <?php foreach ($cates as $cate){ ?>
            <li>
                <a href="list.php?cID=<?php echo $cate['cate_id']; ?>">
                    <?php echo $cate['alias'] ?>
                </a>
            </li>
        <?php } ?>
    </ul>
</div>
<div class="mainArea">
    <?php
    //    require_once  'static/inc/data.php';
    //    require_once  'static/inc/head.php';
    //显示主题内容
        foreach ($cates as $cateKey => $cateValue)
        {
            echo "<div class='area'><a href='list.php?cID=".$cateValue['cate_id']."'><h2>" . $cateValue['alias'] . "</h2></a></div>";
            echo "<ul>";
            foreach ($movies as $movieValue)
            {
                if($cateValue['cate_id']==$movieValue['cate_id'])
                {
                    echo '<li>';
                    echo "<a href='details.php?mID=" . $movieValue['cate_id'] . "'><img src='static/images/" . $movieValue['image'] . "' alt='" . $movieValue['name'] . "'></a><br>" . $movieValue['name'] ;
                    echo '</li>';
                }
            }
            echo '</ul>';
        }
    ?><br><br><br>
        <div class="footer">
            <p class="copyright">欧阳克 © 版权所有</p>
        </div>
    </body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

list分类页面

4.jpg

实例

<?php
    // 视频相关的 作为一个数组,二维数组
    $movies = [
            [
                // 视频ID
                    'mov_id'=>1,
                    'name'=>'倚天屠龙记',
                    'image'=>'1.jpg',
                    'detail'=>'元朝末年,群雄纷起,武林动荡。江湖传闻,得到屠龙刀倚天剑者,可以成为武林至尊,号令天下,莫敢不从。一时间风云四起,引发了武林中对屠龙刀倚天剑的争夺,几段姻缘和孽缘也由此产生。武当派张翠山与天鹰教殷素素…	',
                // 分类ID
                    'cate_id'=>1
            ],
            [
                    'mov_id'=>2,
                    'name'=>'都挺好',
                    'image'=>'2.jpg',
                    'detail'=>' 苏母的的突然离世打破了这个家庭外表的平静,意想不到的隐患层层显露,对毫无主见却又自私、小气的苏父的安置和后续生活问题,引发了远在国外的大哥与本城的二哥、小妹三家规律生活的不再。一直被苏母压制的苏父翻…	',
                    'cate_id'=>1
            ],
            [
                    'mov_id'=>3,
                    'name'=>'如果可以这样爱',
                    'image'=>'3.jpg',
                    'detail'=>'一对已婚男女突然徇情自杀,以为可以结束这一切,却不料悲剧才刚刚开始——他们的爱人,耿墨池和白考儿,同时在葬礼上邂逅。面对同样的背叛他们同时选择报复但又同时爱上彼此,注定饱受打击和折磨。然而他们想真心拥…	',
                    'cate_id'=>1
            ],
            [
                    'mov_id'=>4,
                    'name'=>'复仇者联盟4',
                    'image'=>'4.jpg',
                    'detail'=>'《复仇者联盟4:终局之战》将是漫威宇宙“无限传奇”(The Infinity Saga)的终结篇,是漫威电影宇宙十年的一个重要节点,结束部分英雄电影的故事,但也将展开新的剧情,呈现新的更为广阔宏大的宇…',
                    'cate_id'=>2
            ],
            [
                    'mov_id'=>5,
                    'name'=>'波西米亚狂想曲',
                    'image'=>'5.jpg',
                    'detail'=>'弗雷迪·默丘里成名前在机场做行李搬运工。有一天,默丘里毛遂自荐加入杰·泰勒与布莱恩·梅的乐团,恰巧当天原本的主唱辞职,默丘里用自己横跨四个八度的超广音域说服两人,从此开启皇后乐团的摇滚传奇!',
                    'cate_id'=>2
            ],
            [
                    'mov_id'=>6,
                    'name'=>'阿丽塔:战斗天使',
                    'image'=>'6.jpg',
                    'detail'=>'弗雷迪·默丘里成名前在机场做行李搬运工。有一天,默丘里毛遂自荐加入杰·泰勒与布莱恩·梅的乐团,恰巧当天原本的主唱辞职,默丘里用自己横跨四个八度的超广音域说服两人,从此开启皇后乐团的摇滚传奇!',
                    'cate_id'=>2
            ],
            [
                    'mov_id'=>7,
                    'name'=>'情书',
                    'image'=>'7.jpg',
                    'detail'=>'***神户某个飘雪的冬日,渡边博子(中山美穗)在前未婚夫藤井树的三周年祭日上又一次悲痛到不能自已。正因为无法抑制住对已逝恋人的思念,渡边博子在其中学同学录里发现“藤井树” 在小樽市读书时的地址时,依循着…',
                    'cate_id'=> 3
            ],
            [
                    'mov_id'=>8,
                    'name'=>'天空之城',
                    'image'=>'8.jpg',
                    'detail'=>'韩书珍将两个女儿的教育问题和对丈夫的贤内助工作都做得井井有条,在天空之城之中也是备受瞩目的女王,但其实书珍一直隐藏着不为人所知的秘密。李秀林是个充满了关怀和情感丰沛的童话作家,在书珍的引导之下成为了天…',
                    'cate_id'=>3
            ],
            [
                    'mov_id'=>9,
                    'name'=>'龙猫',
                    'image'=>'9.jpg',
                    'detail'=>'为了方便妻子草壁靖子养病,草壁达郎决定带着两个女儿草壁皋月和草壁米搬到草壁靖子所在疗养院附近的乡下,父女三人入住了一间年久失修的老房子。小姐妹俩很快发现看似平凡无奇的乡下有很多神奇的事物,无人居住的房…',
                    'cate_id'=>3
            ],
    ];

    // 栏目数组
    // 一维数组,无法进行跳转,所以使用二维数组
    $cates = [
            ['cate_id'=>1, 'name'=>'gc', 'alias'=>'国产好剧'],
            ['cate_id'=>2, 'name'=>'om', 'alias'=>'欧美猛片'],
            ['cate_id'=>3, 'name'=>'rh', 'alias'=>'日韩新片'],
    ];

//    评论内容
    $talks = [
            [
                    'talk_id' => 1,
                    'talk_info' => '评价1:倚天屠龙记倚天屠龙记倚天屠龙记',
                    'talk_time' => '2019-1-1',
                    'mov_id' => 1
            ],
            [
                    'talk_id' => 2,
                    'talk_info' => '评价2:倚天屠龙记倚天屠龙记倚天屠龙记',
                    'talk_time' => '2019-1-2',
                    'mov_id' => 1
            ],
            [
                    'talk_id' => 3,
                    'talk_info' => '评价3:倚天屠龙记倚天屠龙记倚天屠龙记',
                    'talk_time' => '2019-1-3',
                    'mov_id' => 1
            ],
            [
                    'talk_id' => 4,
                    'talk_info' => '评价1:都挺好都挺好都挺好',
                    'talk_time' => '2019-1-4',
                    'mov_id' => 2
            ],
            [
                    'talk_id' => 5,
                    'talk_info' => '评价1:如果可以这样爱如果可以这样爱如果可以这样爱',
                    'talk_time' => '2019-1-5',
                    'mov_id' => 3
            ],
            [
                    'talk_id' => 6,
                    'talk_info' => '评价2:如果可以这样爱',
                    'talk_time' => '2019-1-6',
                    'mov_id' => 3
            ]
    ];
    // 网站的系统设置,一维数组
    $system = [
            'sys_id'=>1,
            'title'=>'私人影院',
            'desc'=>'收集全网最新最全的影视资源',
            'key'=>'国产,欧美,日韩',
            'copy'=>'php中文网'
    ];
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="static/css/style.css">
    <meta name="description" content="<?php echo $system['desc'] ?>">
    <meta name="keywords" content="<?php echo $system['key'] ?>">
    <title><?php echo $system['title'] ?></title>
</head>
<body>
<!--头部导航-->
<div class="header">
    <ul class="nav">
        <li><a href="index.php">list分类页</a></li>
        <?php foreach ($cates as $cate){ ?>
            <li>
                <a href="list.php?cID=<?php echo $cate['cate_id']; ?>">
                    <?php echo $cate['alias'] ?>
                </a>
            </li>
        <?php } ?>
    </ul>
</div>
<div class="mainArea">
    <ul>
<?php
    $cateID=$_GET['cID'];
    foreach ($cates as $cate)
    {
        if($cate['cate_id']==$cateID)
        {
            echo "<div class='area'><h2>" . $cate['alias'] . "</h2></div>";
            $cateID=$cate['cate_id'];
            foreach ($movies as $movie)
            {
                if($movie['cate_id']==$cateID)
                {
                    echo '<li>';
                    echo "<a href='details.php?mID=" . $movie['cate_id'] . "'><img src='static/images/" . $movie['image'] . "' alt='" . $movie['name'] . "'></a><br>" . $movie['name'] ;
                    echo '</li>';
                }
            }
            break;
        }
    }
?>
    </ul>
</div>
        <div class="footer">
            <p class="copyright">欧阳克 © 版权所有</p>
        </div>
    </body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

details详情页

3.jpg

实例

<?php
    // 视频相关的 作为一个数组,二维数组
    $movies = [
            [
                // 视频ID
                    'mov_id'=>1,
                    'name'=>'倚天屠龙记',
                    'image'=>'1.jpg',
                    'detail'=>'元朝末年,群雄纷起,武林动荡。江湖传闻,得到屠龙刀倚天剑者,可以成为武林至尊,号令天下,莫敢不从。一时间风云四起,引发了武林中对屠龙刀倚天剑的争夺,几段姻缘和孽缘也由此产生。武当派张翠山与天鹰教殷素素…	',
                // 分类ID
                    'cate_id'=>1
            ],
            [
                    'mov_id'=>2,
                    'name'=>'都挺好',
                    'image'=>'2.jpg',
                    'detail'=>' 苏母的的突然离世打破了这个家庭外表的平静,意想不到的隐患层层显露,对毫无主见却又自私、小气的苏父的安置和后续生活问题,引发了远在国外的大哥与本城的二哥、小妹三家规律生活的不再。一直被苏母压制的苏父翻…	',
                    'cate_id'=>1
            ],
            [
                    'mov_id'=>3,
                    'name'=>'如果可以这样爱',
                    'image'=>'3.jpg',
                    'detail'=>'一对已婚男女突然徇情自杀,以为可以结束这一切,却不料悲剧才刚刚开始——他们的爱人,耿墨池和白考儿,同时在葬礼上邂逅。面对同样的背叛他们同时选择报复但又同时爱上彼此,注定饱受打击和折磨。然而他们想真心拥…	',
                    'cate_id'=>1
            ],
            [
                    'mov_id'=>4,
                    'name'=>'复仇者联盟4',
                    'image'=>'4.jpg',
                    'detail'=>'《复仇者联盟4:终局之战》将是漫威宇宙“无限传奇”(The Infinity Saga)的终结篇,是漫威电影宇宙十年的一个重要节点,结束部分英雄电影的故事,但也将展开新的剧情,呈现新的更为广阔宏大的宇…',
                    'cate_id'=>2
            ],
            [
                    'mov_id'=>5,
                    'name'=>'波西米亚狂想曲',
                    'image'=>'5.jpg',
                    'detail'=>'弗雷迪·默丘里成名前在机场做行李搬运工。有一天,默丘里毛遂自荐加入杰·泰勒与布莱恩·梅的乐团,恰巧当天原本的主唱辞职,默丘里用自己横跨四个八度的超广音域说服两人,从此开启皇后乐团的摇滚传奇!',
                    'cate_id'=>2
            ],
            [
                    'mov_id'=>6,
                    'name'=>'阿丽塔:战斗天使',
                    'image'=>'6.jpg',
                    'detail'=>'弗雷迪·默丘里成名前在机场做行李搬运工。有一天,默丘里毛遂自荐加入杰·泰勒与布莱恩·梅的乐团,恰巧当天原本的主唱辞职,默丘里用自己横跨四个八度的超广音域说服两人,从此开启皇后乐团的摇滚传奇!',
                    'cate_id'=>2
            ],
            [
                    'mov_id'=>7,
                    'name'=>'情书',
                    'image'=>'7.jpg',
                    'detail'=>'***神户某个飘雪的冬日,渡边博子(中山美穗)在前未婚夫藤井树的三周年祭日上又一次悲痛到不能自已。正因为无法抑制住对已逝恋人的思念,渡边博子在其中学同学录里发现“藤井树” 在小樽市读书时的地址时,依循着…',
                    'cate_id'=> 3
            ],
            [
                    'mov_id'=>8,
                    'name'=>'天空之城',
                    'image'=>'8.jpg',
                    'detail'=>'韩书珍将两个女儿的教育问题和对丈夫的贤内助工作都做得井井有条,在天空之城之中也是备受瞩目的女王,但其实书珍一直隐藏着不为人所知的秘密。李秀林是个充满了关怀和情感丰沛的童话作家,在书珍的引导之下成为了天…',
                    'cate_id'=>3
            ],
            [
                    'mov_id'=>9,
                    'name'=>'龙猫',
                    'image'=>'9.jpg',
                    'detail'=>'为了方便妻子草壁靖子养病,草壁达郎决定带着两个女儿草壁皋月和草壁米搬到草壁靖子所在疗养院附近的乡下,父女三人入住了一间年久失修的老房子。小姐妹俩很快发现看似平凡无奇的乡下有很多神奇的事物,无人居住的房…',
                    'cate_id'=>3
            ],
    ];

    // 栏目数组
    // 一维数组,无法进行跳转,所以使用二维数组
    $cates = [
            ['cate_id'=>1, 'name'=>'gc', 'alias'=>'国产好剧'],
            ['cate_id'=>2, 'name'=>'om', 'alias'=>'欧美猛片'],
            ['cate_id'=>3, 'name'=>'rh', 'alias'=>'日韩新片'],
    ];

//    评论内容
    $talks = [
            [
                    'talk_id' => 1,
                    'talk_info' => '评价1:倚天屠龙记倚天屠龙记倚天屠龙记',
                    'talk_time' => '2019-1-1',
                    'mov_id' => 1
            ],
            [
                    'talk_id' => 2,
                    'talk_info' => '评价2:倚天屠龙记倚天屠龙记倚天屠龙记',
                    'talk_time' => '2019-1-2',
                    'mov_id' => 1
            ],
            [
                    'talk_id' => 3,
                    'talk_info' => '评价3:倚天屠龙记倚天屠龙记倚天屠龙记',
                    'talk_time' => '2019-1-3',
                    'mov_id' => 1
            ],
            [
                    'talk_id' => 4,
                    'talk_info' => '评价1:都挺好都挺好都挺好',
                    'talk_time' => '2019-1-4',
                    'mov_id' => 2
            ],
            [
                    'talk_id' => 5,
                    'talk_info' => '评价1:如果可以这样爱如果可以这样爱如果可以这样爱',
                    'talk_time' => '2019-1-5',
                    'mov_id' => 3
            ],
            [
                    'talk_id' => 6,
                    'talk_info' => '评价2:如果可以这样爱',
                    'talk_time' => '2019-1-6',
                    'mov_id' => 3
            ]
    ];
    // 网站的系统设置,一维数组
    $system = [
            'sys_id'=>1,
            'title'=>'私人影院',
            'desc'=>'收集全网最新最全的影视资源',
            'key'=>'国产,欧美,日韩',
            'copy'=>'php中文网'
    ];
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="static/css/style.css">
    <meta name="description" content="<?php echo $system['desc'] ?>">
    <meta name="keywords" content="<?php echo $system['key'] ?>">
    <title><?php echo $system['title'] ?></title>
</head>
<body>
<!--头部导航-->
<div class="header">
    <ul class="nav">
        <li><a href="index.php">details详情页</a></li>
        <?php foreach ($cates as $cate){ ?>
            <li>
                <a href="list.php?cID=<?php echo $cate['cate_id']; ?>">
                    <?php echo $cate['alias'] ?>
                </a>
            </li>
        <?php } ?>
    </ul>
</div>
<div class="mainArea">
<ul>
    <?php
    $mID=$_GET['mID'];
            foreach ($movies as $movie)
            {
                if($movie['mov_id']==$mID)
                {
                    echo '<li>';
                    echo $movie['name']  . "<br><img src='static/images/" . $movie['image'] . "' alt='" . $movie['name'] . "'><br>" ;
                    echo '<hr>';
                    foreach ($talks as $talk)
                    {
                        if($talk['mov_id']==$movie['mov_id'])
                        {
                            echo "<br><span class='talkList'>" . $talk['talk_time'] . "<br>" . $talk['talk_info'] . "</span>";
                        }
                    }
                    echo '</li>';
                }
            }
    ?>
</ul>
</div>
        <div class="footer">
            <p class="copyright">欧阳克 © 版权所有</p>
        </div>
    </body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

 

Correction status:qualified

Teacher's comments:完成的不错,继续加油
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post