<?php
include('connection.php');
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Get the new platform data from the form
    $newPlatform = $_POST["name"];

    // Validate and sanitize the input (You can add more validation as needed)
    $newPlatform = htmlspecialchars($newPlatform);
    $currentDate = date('Y-m-d');
    

    // Insert the new platform data into the database (Replace with your SQL query)
    $sql = "INSERT INTO add_service (name,datetime) VALUES ('$newPlatform','$currentDate')";

    if ($conn->query($sql) === TRUE) {

        // echo "New platform added successfully!";
        header("Location: add_service.php?success = New service added successfully!!!");

    } else {
        echo "Error: " . $sql . "<br>" . $conn->error;
    }

    // Close the database connection
    $conn->close();
}
?>