Sindbad~EG File Manager

Current Path : /home/u625735752/domains/feednationngo.org/public_html/
Upload File :
Current File : /home/u625735752/domains/feednationngo.org/public_html/foot-harvest-submit.php

<?php
// Check if the form is submitted
if ($_SERVER["REQUEST_METHOD"] == "POST") {

    // Get form data
    $name = isset($_POST['name']) ? $_POST['name'] : '';
    $contact = isset($_POST['contact']) ? $_POST['contact'] : '';
    $address = isset($_POST['address']) ? $_POST['address'] : '';
    $quantity = isset($_POST['quantity']) ? $_POST['quantity'] : '';

    // Prepare the email
    $to = "feednationngo@gmail.com";  // The email address to send the data to
    $subject = "Food Festival 2024: New Submission";  // Email subject
    $message = "New form submission for the Food Festival 2024:\n\n";
    $message .= "Name: $name\n";
    $message .= "Contact Number: $contact\n";
    $message .= "Address: $address\n";
    $message .= "Quantity: $quantity\n";

    // Headers for the email
    $headers = "From: no-reply@yourdomain.com\r\n";
    $headers .= "Reply-To: $contact\r\n"; // The user's contact as the reply-to address
    $headers .= "Content-Type: text/plain; charset=UTF-8\r\n";

    // Send the email
    $mail_sent = mail($to, $subject, $message, $headers);

    // Check if the email was sent successfully
    if ($mail_sent) {
        // Redirect to the landing page after the form submission
        header("Location: landing-page.php");
        exit();
    } else {
        echo "There was an error sending the email.";
    }
}
?>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists