One Hat Cyber Team
Your IP :
216.73.216.186
Server IP :
147.79.69.25
Server :
Linux in-mum-web1837.main-hosting.eu 5.14.0-503.34.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 27 06:00:50 EDT 2025 x86_64
Server Software :
LiteSpeed
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
u322583024
/
domains
/
jimmy2chs.in
/
public_html
/
View File Name :
upload_image.php
<?php require('connection.inc.php'); // Check if the form is submitted if ($_SERVER["REQUEST_METHOD"] == "POST") { // Check if file was uploaded without errors if (isset($_FILES["image"]) && $_FILES["image"]["error"] == 0) { $allowedExtensions = array("jpg", "jpeg", "png", "gif"); $fileExtension = pathinfo($_FILES["image"]["name"], PATHINFO_EXTENSION); // Check if the file extension is allowed if (in_array($fileExtension, $allowedExtensions)) { $targetDir = "assets/images/user/"; $targetFileName = uniqid() . '.' . $fileExtension; $targetFilePath = $targetDir . $targetFileName; // Move the uploaded file to the specified directory if (move_uploaded_file($_FILES["image"]["tmp_name"], $targetFilePath)) { // Update the database with the image path $userId = $_SESSION['USER_ID']; // Assuming you have the user ID stored in session $updateQuery = "UPDATE members SET img = ? WHERE id = ?"; if ($stmt = mysqli_prepare($con, $updateQuery)) { mysqli_stmt_bind_param($stmt, "si", $targetFileName, $userId); if (mysqli_stmt_execute($stmt)) { echo "Image uploaded and database updated successfully!"; } else { echo "Error updating database."; } mysqli_stmt_close($stmt); } else { echo "Error: Could not prepare statement."; } } else { echo "Error uploading file."; } } else { echo "Invalid file extension."; } } else { echo "Error uploading file."; } } else { echo "Invalid request."; } ?>