-
Notifications
You must be signed in to change notification settings - Fork 4
/
post.php
executable file
·91 lines (68 loc) · 2.61 KB
/
post.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
<?php
include ("header.php");
$id = $_GET["id"]; // burada sql inj olabilir :)
$postdata = postData($id);
if ($postdata != 0) {
if ($_POST["c_username"]!= "" && $_POST["c_email"] !="" && $_POST["c_text"] != "") {
addComment($_POST["c_username"], $_POST["c_email"], $_POST["c_text"],$id); // burda js ile kontrol yaparıız trafıgın arasına gırıp script bassarlar
// addComment 1 => başarılı 0 => hata
}
$comment_data = commentsData($id);
?>
<div class="row">
<!-- Blog Post Content Column -->
<div class="col-lg-8">
<!-- Blog Post -->
<!-- Title -->
<h1><?= $postdata["title"]; ?></h1>
<!-- Author -->
<p class="lead">
by <a href="about.php"><?= $postdata["username"] ?></a>
</p>
<hr>
<!-- Date/Time -->
<p><span class="glyphicon glyphicon-time"></span> Posted on <?= $postdata["created_at"] ?></p>
<hr>
<!-- Preview Image -->
<?php
if ($postdata["photo_path"] != "") {
echo '<img class="img-responsive" src="uploads/'.$postdata["photo_path"].'" alt="">';
}
?>
<hr>
<!-- Post Content -->
<p><?= $postdata["text"];?></p>
<hr>
<!-- Blog Comments -->
<!-- Comments Form -->
<div class="well">
<h4>Leave a Comment:</h4>
<form role="form" action="" method="POST" id="comment">
<div class="form-group">
<input class="form-control" type="text" id="username" name="c_username" placeholder="Username" value="">
<br>
<input class="form-control" type="text" id="email" name="c_email" placeholder="Email" value="">
<br>
<textarea class="form-control" rows="3" id="text" name="c_text" placeholder="Your comment"></textarea>
</div>
<button type="submit" id="submit" class="btn btn-primary">Submit</button>
</form>
</div>
<hr>
<!-- Posted Comments -->
<?php commentDom($id); ?>
<!-- Yorumları bas -->
</div> <!-- end col-lg-8 -->
<!-- Blog Sidebar Widgets Column -->
<div class="col-md-4">
<?php include ("right_bar.php"); ?>
</div>
</div>
<!-- /.row -->
<hr>
<script src="js/post.js"></script>
<?php
} else { // if end
echo "Sen hayırdır";
}
include ("footer.php");