| Server IP : 173.209.174.21 / Your IP : 216.73.216.89 Web Server : Apache/2.4.58 (Ubuntu) System : Linux wcfs-server 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : nodor ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/thelittlebigshow/app/admin/ |
Upload File : |
<?php
session_start();
ob_start();
require_once 'config/config.php';
require_once BASE_PATH . '/includes/auth_validate.php';
include_once("../db.php");
// Costumers class
include BASE_PATH . '/includes/header.php';
?>
<style>
label{
font-size: 16px !important;
}
p{
font-size: 18px !important;
}
.flex-page-header{
display: flex;
justify-content: space-between;
align-items: center;
}
</style>
<!-- Main container -->
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<div class="page-header flex-page-header">
<h1>Create Categories</h1>
<a href="categories.php" class="btn btn-primary">View</a>
</div>
</div>
</div>
<form action="" method="POST">
<fieldset>
<div class="form-group">
<label for="vehicles">Category Name</label>
<input type="text" name="category" class="form-control">
</div>
<div class="form-group">
<label for="vehicles">Category Color</label>
<input type="color" name="color" class="form-control">
</div>
<div class="form-group w-25">
<div class="text-center">
<button type="submit" name="submit" class="btn btn-info">Create Category</button>
</div>
</div>
</fieldset>
</form>
<?php
// Create Password
if(isset($_POST["submit"])){
$category = $_POST["category"];
$color = $_POST["color"];
$sql = "INSERT INTO category(name,color) VALUES ('$category','$color')";
if(mysqli_query($conn, $sql)){
$_SESSION['success']="Category Created Successful!";
header('Location: categories.php');
}else{
$_SESSION['failure']="Please Try Again!!";
}
}
?>
</div>
<!-- //Main container -->
<?php include BASE_PATH . '/includes/footer.php';?>