-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathgenres.php
More file actions
41 lines (33 loc) · 966 Bytes
/
genres.php
File metadata and controls
41 lines (33 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require 'tohost.php';
// Fetch genres
$response = file_get_contents(BASE_API_URL . 'api/v2/hianime/home');
$data = json_decode($response, true);
if (!$data || !$data['success']) {
die("Failed to fetch genres.");
}
$genres = $data['data']['genres'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Genres - Anime World</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<?php include 'header.html'; ?>
<main class="container">
<section>
<h2>Anime Genres</h2>
<div class="genres-list">
<?php foreach ($genres as $genre): ?>
<a href="search.php?q=&genres=<?= urlencode($genre) ?>"><?= htmlspecialchars($genre) ?></a>
<?php endforeach; ?>
</div>
</section>
</main>
<?php include 'footer.html'; ?>
</body>
</html>