-
Notifications
You must be signed in to change notification settings - Fork 0
/
icerik.php
115 lines (95 loc) · 1.91 KB
/
icerik.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
include 'baglan.php';
$icerik=$db->prepare("select * from icerikler where seo=:seo");
$icerik->execute(array('seo' => $_GET['seo']));
$icerikgetir=$icerik->fetch(PDO::FETCH_ASSOC);
if(!isset($_COOKIE[$icerikgetir['seo']])){
$up=$db->prepare("UPDATE icerikler SET hit=hit+1
where seo=:seo ");
$hit=$up->execute(array("seo"=>$icerikgetir['seo']));
if ($hit) {
$url = 'http://localhost/hit/'.$icerikgetir['seo'];
setcookie($icerikgetir['seo'],'okundu',time()+(60*60*24*30), $url);
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Bulutasarim.com</title>
<style type="text/css">
body{
margin: 0 auto;
padding: 0;
}
nav{
height: 50px;
background-color: red;
margin-bottom: 25px;
}
section{
margin: 0 auto;
width: auto;
text-align: center;
}
.sub{
width: 25%;
text-align: center;
margin: 0 auto;
margin-bottom: 15px;
position: relative;
}
.sub a{
text-decoration: none;
font-size: 20px;
font-weight: 600;
font-family:sans-serif;
color:#421916;
}
.metin{
max-width: 900px;
text-align: center;
margin: 0 auto;
}
.kutu{
margin-bottom: 25px
}
.hit{
background: gray;
color: white;
padding: 3px;
font-family: sans-serif;
}
nav .geri{
background-color: white;
width: fit-content;
padding: 16px;
}
nav .geri a{
font-family: sans-serif;
font-weight: 700;
text-decoration: none;
color: cornflowerblue;
}
</style>
</head>
<body>
<nav>
<div class="geri">
<a href="./"> GERİ</a>
</div>
</nav>
<section>
<div>
<div class="kutu">
<img src="<?php echo $icerikgetir['img'];?>" width="25%">
<div class="sub">
<a href="<?php echo $icerikgetir['seo'];?>"><?php echo $icerikgetir['konu'];?></a>
</div>
<p class="metin"><?php echo $icerikgetir['metin'];?></p>
<p class="metin"><?php echo ($icerikgetir['icerik_tarih']);?></p>
</div>
</div>
</section>
</body>
</html>