-
Notifications
You must be signed in to change notification settings - Fork 0
/
AddFaq.php
85 lines (68 loc) · 2.13 KB
/
AddFaq.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
<?php
include("connection.php");
include("Inc_admin_dash.php");
?>
<!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>Add FAQs</title>
<!--Font Awesome and online Links --->
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<!--style1 css--->
<link rel="stylesheet" href="dash_css/style1.css">
<!--End Here--->
<body>
<div id="page-wrapper" class="gray-bg dashbard-1">
<div class="content-main">
<!--banner-->
<div class="banner">
<h2>
<a href="index.php">Home</a>
<i class="fa fa-angle-right"></i>
<span>Add FAQs</span>
</h2>
</div>
<div class="grid-form">
<div class="grid-form1">
<h3 id="forms-example" class="">Add New FAQs</h3>
<hr>
<form method="post">
<div class="form-group">
<h4 style="padding-left:20px;">FAQ (Frequently Asked Questions)</h4>
<input type="text" name="faq" class="form-control cat" required="">
</div>
<div class="form-group">
<h4 style="padding-left:20px;">Reply!</h4>
<input type="text" name="ans" class="form-control cat" required="">
</div>
<button style="border-radius:10%; margin-left:20px;" name="btnadd" type="submit" class="btn btn-dark">Add</button>
<!-- PHP Start -->
<?php
if(isset($_POST['btnadd']))
{
$faq_Q = $_POST['faq'];
$faq_A = $_POST['ans'];
$query = mysqli_query($con,"insert into faqs(question,answer)
values ('$faq_Q','$faq_A')");
if($query > 0)
{
echo"
<div style='margin-top:5px;' class='alert alert-success' role='alert'>
<b>Successfully!</b>FAQ added!
</div>
";
}
else
{
echo "<script>alert('Failed!')</script>";
}
}
?>
<!-- End Here -->
</form>
</div>
</body>
</html>