forked from alimakhdoom/WAD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinsert_category.php
58 lines (53 loc) · 2.22 KB
/
insert_category.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
<?php
require_once "db_connection.php";
print_r($_POST);
if(isset($_POST['insert_cat'])){
//getting text data from the fields
$cat_title = $_POST['cat_title'];
$insert_product = "insert into categories (cat_title)
VALUES ('$cat_title')";
$insert_product = mysqli_query($con, $insert_product);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Insert Product</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" href="../css/bootstrap.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bangers|Old+Standard+TT">
<style>
* {
font-family: 'Old Standard TT', serif;
}
</style>
</head>
<body>
<div class="container">
<h1 class="text-center my-4"><i class="fas fa-plus fa-md"></i> <span class="d-none d-sm-inline"> Add New </span> Category </h1>
<form action="" method="post" enctype="multipart/form-data">
<div class="row">
<div class="d-none d-sm-block col-sm-3 col-md-4 col-lg-2 col-xl-2 mt-auto">
<label for="cat_title" class="float-md-right"> <span class="d-sm-none d-md-inline"> Category </span> Title:</label>
</div>
<div class="col-sm-9 col-md-8 col-lg-4 col-xl-4">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text"><i class="fas fa-file-signature"></i></div>
</div>
<input type="text" class="form-control" id="cat_title" name="cat_title" placeholder="Enter Category" >
</div>
</div>
</div>
<div class="row my-3">
<div class="d-none d-sm-block col-sm-3 col-md-4 col-lg-2 col-xl-2 mt-auto"></div>
<div class="col-sm-9 col-md-8 col-lg-4 col-xl-4">
<button type="submit" name="insert_cat" class="btn btn-primary btn-block"><i class="fas fa-plus"></i> Insert Now </button>
</div>
</div>
</form>
</div>
</body>
</html>