Sid Gifari File Manager
🏠Root
/
home
/
u527040259
/
domains
/
techamber.in
/
.trash
/
📝 Editing: add-pro2.php
<?php include '../conn.php'; $error = ' '; $brdr = ' '; $light_mode = ":root{--bg:#fff;--base-color:#000;--light-sec-color: #e9effd;--stroke-color:#0094ff;}"; $dark_mode = ":root{--bg:#101827;--base-color:#fff;--light-sec-color: rgba(21, 30, 47,1);--stroke-color:#0094ff;}"; if (isset($_GET['theme'])) { $css = $dark_mode; $theme = '?theme=dark'; $theme_del = '&theme=dark'; } else { $css = $light_mode; $theme = ' '; $theme_del = ' '; } $sqlc = "SELECT * FROM categories"; $queryc = mysqli_query($con, $sqlc); $numc = mysqli_num_rows($queryc); if ($_SERVER['REQUEST_METHOD'] === 'POST') { $theme = $_POST['theme']; $theme_id = $_POST['theme_id']; $theme_acc = $_POST['theme_acc']; $theme_path = $_POST['theme_path']; $theme_price = $_POST['theme_price']; $technologies = $_POST['technologies']; $status = $_POST['status']; $story = $_POST['story']; $des = $_POST['des']; $cat = $_POST['cat']; $str = explode("/", $cat); $parent_cat = $str[0]; $sub_cat = $str[1]; $file_name = uniqid() . '_' . $_FILES['theme_image']['name']; $file_tmp = $_FILES['theme_image']['tmp_name']; $file_type = $_FILES['theme_image']['type']; $file_size = $_FILES['theme_image']['size']; $upload_path = "product_images/"; $target_file = $upload_path . basename($file_name); $file_extension = strtolower(pathinfo($target_file, PATHINFO_EXTENSION)); $allowed_extensions = array('jpeg', 'jpg', 'png', 'gif'); if (in_array($file_extension, $allowed_extensions)) { if ($file_size < 5242880) { move_uploaded_file($file_tmp, $target_file); $sql = "INSERT INTO `themes` (`theme_name`, `theme_code`, `theme_acc_color`, `theme_path`, `price`, `technologies`, `des`, `story`, `sub-cat`, `cat`, `status`, `img`) VALUES ('$theme', '$theme_id', '$theme_acc', '$theme_path', '$theme_price', '$technologies', '$des', '$story', '$sub_cat', '$parent_cat', '$status', '$file_name')"; $query = mysqli_query($con, $sql); if ($query) { header('location: https://techamber.in/admin/admin_panel/add-pro2?tc='.$theme_id.$theme_del); } else { $error = "Theme upload failed due to an unknown error"; } } else { $brdr = 'border'; $error = 'File size exceeds the limit. Maximum file size allowed is 5MB.'; } } else { $brdr = 'border'; $error = 'Invalid file extension. Only JPEG, JPG, PNG, and GIF files are allowed.'; } } ?> <!DOCTYPE html> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> <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"> <link rel="stylesheet" href="../css/addpro.css"> <title>Upload Themes</title> <style> <?php echo $css; ?> </style> </head> <body> <div class="wrapper"> <h1>Upload Themes</h1> <form action="" method='post' enctype="multipart/form-data"> <div class="d-flex"> <textarea name="tags" placeholder="Story" value="<?php echo $story; ?>" required></textarea> </div> <span class="error"><?php echo $error ?></span> <div class="d-flex justify-content-center"> <button name="submit" type="submit">Upload Theme</button> </div> </form> </div> </body> </html>
đź’ľ Save
❌ Cancel
Sid Gifari File Manager v1.0 | Terminal Auto-Sync Enabled | Current Path: /home/u527040259/domains/techamber.in/.trash