<?php
// Include database connection code here if not already included
Include('connection.php');

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Get form data
    $title = $_POST["title"];
    $group = $_POST["group"];
    $platefrom = $_POST["platefrom"];
    $description = $_POST["description"];
    $url = $_POST["url"];
    $pdf = $_POST["pdf"];
    $audio = $_POST["audio"];
    $video = $_POST["video"];
    $image = $_POST["image"];
    $msg = $_POST["msg"];
    $currentDateTime = date('Y-m-d H:i:s');

    // Add your database insert query here
    // For example:
    $sql = "INSERT INTO member_update_task (title, member, platefrom, description, url, pdf, audio, video, image, msg, datetime) VALUES ('$title', '$group', '$platefrom', '$description', '$url', '$pdf', '$audio', '$video', '$image', '$msg','$currentDateTime')";

   
    if (mysqli_query($conn, $sql)) {

        // echo "Data inserted successfully!";
        header("Location: user_active_task.php?error = Data inserted successfully!!!");


    } else {
        echo "Error: " . mysqli_error($conn);
    }

    // Close the database connection if it's open
    mysqli_close($conn);

   
}
