-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.php
More file actions
executable file
·103 lines (86 loc) · 3.24 KB
/
command.php
File metadata and controls
executable file
·103 lines (86 loc) · 3.24 KB
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
<?php
include 'head.php'
?>
<?php
include 'config.php';
error_reporting(0); // For not showing any error
if (isset($_POST['submit'])) { // Check press or not Post Comment Button
$name = $_POST['name']; // Get Name from form
$email = $_POST['email']; // Get Email from form
$comment = $_POST['comment']; // Get Comment from form
$sql = "INSERT INTO comments (name, email, comment)
VALUES ('$name', '$email', '$comment')";
$result = mysqli_query($conn, $sql);
if ($result) {
echo "<script>alert('Comment added successfully.')</script>";
} else {
echo "<script>alert('Comment does not add.')</script>";
}
}
?>
<!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">
<title>command</title>
</head>
<body >
<style>
body{
background-image: url(img/ccc.jpeg);
background-repeat: no-repeat;
/*background-attachment: fixed;*/
background-size: cover;}
</style>
<!--commmt start-->
<center>
<section class="any query" id="any query">
<h1 style="font-size:40px; text-align: center;">Asked_question <i class="fas fa-question-circle"></i></h1>
<p style="font-size: 3.0rem; margin:1rem auto;"> "যারা নিবন্ধনে করেছেন শুধুমাত্র তারা প্রতিউত্তর পাবেন " </p>
<div class="wrapper">
<form action="" method="POST" class="form">
<div class="row">
<div class="input-group">
<label for="name"> <i class="fa fa-user" aria-hidden="true"></i> Name</label>
<input type="text" name="name" id="name" placeholder="Enter your Name" required>
</div>
<div class="input-group">
<label for="email"> <i class="fas fa-envelope"></i> Email</label>
<input type="email" name="email" id="email" placeholder="Enter your Email" required>
</div>
</div>
<div class="input-group textarea">
<label for="comment"> <i class="fas fa-comment"></i>Comment</label>
<textarea id="comment" name="comment" placeholder="Enter your Comment" required></textarea>
</div>
<div class="input-group">
<button name="submit" class="btn" > <i class="fas fa-comment"></i> Comment</button>
</div>
</form>
<div class="prev-comments">
<?php
$sql = "SELECT * FROM comments";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
?>
<div class="single-item">
<h4><?php echo $row['name']; ?></h4>
<a href="mailto:<?php echo $row['email']; ?>"><?php echo $row['email']; ?></a>
<p><?php echo $row['comment']; ?></p>
</div>
<?php
}
}
?>
</div>
</div>
</section>
</center>
<!--commt end-->
</body>
<?php
include 'foot.php'?>
</html>