-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddthread.php
More file actions
45 lines (39 loc) · 1.72 KB
/
addthread.php
File metadata and controls
45 lines (39 loc) · 1.72 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
<?php
include 'css/connection.php';
$METHOD = $_SERVER['REQUEST_METHOD'];
if ($METHOD == 'POST') {
$desc=$_POST['categorydesc'];
$name=$_POST['categoryname'];
if($name!=""){
$sql="INSERT INTO `catagerois` (`category_name`, `category _description`, `created`) VALUES ('$name', '$desc', current_timestamp())
";
$result=mysqli_query($conn,$sql);
header("location: index.php");
}
}
?>
<div class="modal fade" id="addthread" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="/projects/addthread.php" method="POST">
<div class="form-group">
<label for="exampleInputEmail1">Category name</label>
<input type="text" class="form-control" id="categoryname" name="categoryname" aria-describedby="emailHelp">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Category description</label>
<input type="text" class="form-control" id="categorydesc" name="categorydesc">
</div>
<button type="submit" class="btn btn-primary">Add</button>
</form>
</div>
</div>
</div>
</div>