|
Server IP : 2a02:4780:11:767:0:2c41:85d9:6 / Your IP : 216.73.217.91 Web Server : LiteSpeed System : Linux in-mum-web667.main-hosting.eu 5.14.0-570.62.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 10:10:59 EST 2025 x86_64 User : u742491609 ( 742491609) PHP Version : 8.1.34 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u742491609/domains/apca.org.in/public_html/admin/connectivity/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
require 'config.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$title = $_POST['title'];
$category = $_POST['category'];
$description = $_POST['description'];
$stmt = $pdo->prepare("INSERT INTO sections (title, category, description) VALUES (:title, :category, :description)");
$stmt->execute(['title' => $title, 'category' => $category, 'description' => $description]);
$section_id = $pdo->lastInsertId();
foreach ($_FILES['images']['tmp_name'] as $key => $tmp_name) {
$image_name = $_FILES['images']['name'][$key];
$image_tmp_name = $_FILES['images']['tmp_name'][$key];
$image_path = 'uploads/' . $image_name;
move_uploaded_file($image_tmp_name, $image_path);
$stmt = $pdo->prepare("INSERT INTO images (section_id, image_path) VALUES (:section_id, :image_path)");
$stmt->execute(['section_id' => $section_id, 'image_path' => $image_path]);
}
header('Location: admin_panel.php');
}
?>