<?php
// 网站数据来自数据表
// 1 连接数据库
require __DIR__ . '/connect.php';
// 2. 获取影视信息
$sql = 'SELECT `mov_id`, `name`,`image`,`detail`,`cate_id` FROM `movies`';
$stmt = $pdo-> prepare($sql);
$stmt->execute();
$movies=$stmt->fetchAll(PDO::FETCH_ASSOC);
// 3. 获取栏目信息
$sql = 'SELECT `cate_id`, `name`,`alias` FROM `category`';
$stmt = $pdo-> prepare($sql);
$stmt->execute();
$cates=$stmt->fetchAll(PDO::FETCH_ASSOC);
//count array length
$cate_count = count($cates);
// 3. 获取网站的配置信息
$sql = 'SELECT * FROM `system` LIMIT 1';
$stmt = $pdo-> prepare($sql);
$stmt->execute();
$system = $stmt->fetch(PDO::FETCH_ASSOC);
?>
<!doctype html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="<?php echo $system['desc'];?>">
<meta name="keywords" content="<?php echo $system['key'];?>">
<title><?php echo $system['title'] ?></title>
<!-- <link rel="stylesheet" href="../css/tda.css">-->
<style>
.header {
background-color: #02aaa9;
height: 30px;
}
.nav li {
list-style:none;
min-width:80px;
line-height: 30px;
float: left;
}
.nav li a {
text-decoration: none;
color: white;
}
.nav {
overflow: hidden;
}
.footer {
height: 30px;
background-color: #02aaa9;
color: #ff0c05;
text-align: center;
line-height: 30px;
}
</style>
</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?cate_id=<?php echo $cate['cate_id'] ?>"><?php echo $cate['alias'] ?></a></li>
<?php endforeach; ?>
</ul>
</div>