-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
37 lines (33 loc) · 1.08 KB
/
index.php
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
<?php
require_once 'utility/connect.php';
require_once 'utility/functions.php';
$query = $db->query("SELECT * FROM posts");
$posts = $query->fetchAll(PDO::FETCH_OBJ);
if (empty($posts)) {
exit("Content not found!");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="SEO Url PHP, tolgahanacar.net">
<title>SEO Url - PHP</title>
</head>
<body>
<?php foreach ($posts as $post): ?>
<div>
<label for="<?= htmlspecialchars($post->postname) ?>"><?= htmlspecialchars($post->postname) ?></label>
<p><?= htmlspecialchars($post->postdesc) ?></p>
<a href="post/<?= seolink($post->postname) . '-' . $post->id ?>">More</a>
</div><br><br>
<?php endforeach; ?>
<div>
<h2>Created</h2>
<a href="https://github.com/tolgahanacar">Github</a><br>
<a href="https://tolgahanacar.net">tolgahanacar.net</a>
</div>
</body>
</html>