HEX
Server: Apache
System: Linux p3plzcpnl485017.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: rbrijwzv8p53 (8461783)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/rbrijwzv8p53/public_html/ijavms.com/submitarticle.php
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Display a processing message using JavaScript
    echo '<script>alert("Processing... Please wait.");</script>';
    echo '<script>setTimeout(function(){document.forms["contact-form"].submit();}, 1000);</script>';

    $name = $_POST["name"];
    $email = $_POST["email"];
    $subject = $_POST["subject"];
    $message = $_POST["message"];

    // Handle the uploaded file
    $file_name = "";
    if ($_FILES["attachment"]["error"] == 0) {
        $tmp_name = $_FILES["attachment"]["tmp_name"];
        $file_name = $_FILES["attachment"]["name"];
        $uploads_dir = 'uploads/';

        // Ensure the "uploads" directory exists
        if (!file_exists($uploads_dir)) {
            mkdir($uploads_dir, 0755, true);
        }

        // Move the uploaded file to the "uploads" directory
        $moved = move_uploaded_file($tmp_name, $uploads_dir . $file_name);

        if (!$moved) {
            // Handle the case where the file couldn't be moved
            echo '<script>alert("Failed to move the uploaded file.");</script>';
            exit;
        }
    }

    $to = "editor@ijavms.com";
    $headers = "From: $email";

    // Compose the email message
    $email_message = "Name: $name\n";
    $email_message .= "Email: $email\n";
    $email_message .= "Subject: $subject\n";
    $email_message .= "Message: $message\n";

    // Send the email with attachment
    if ($file_name != "") {
        $file_path = $uploads_dir . $file_name;

        // Read the file content
        $file_content = file_get_contents($file_path);

        // Create a boundary for the email
        $boundary = md5(time());

        // Set the email headers
        $headers .= "\r\nMIME-Version: 1.0\r\n";
        $headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"\r\n";

        // Create the email body
        $email_message = "--$boundary\r\n";
        $email_message .= "Content-Type: text/plain; charset=\"UTF-8\"\r\n";
        $email_message .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
        $email_message .= $name . "\r\n\r\n";
        
        $email_message .= $subject . "\r\n\r\n";
        
        $email_message .= $message . "\r\n\r\n";

        $email_message .= "--$boundary\r\n";
        $email_message .= "Content-Type: application/octet-stream; name=\"$file_name\"\r\n";
        $email_message .= "Content-Disposition: attachment; filename=\"$file_name\"\r\n";
        $email_message .= "Content-Transfer-Encoding: base64\r\n\r\n";
        $email_message .= chunk_split(base64_encode($file_content)) . "\r\n";

        $email_message .= "--$boundary--\r\n";
    }

    // Send the email
    if (mail($to, "New Contact Form Submission", $email_message, $headers)) {
        // Email sent successfully
        echo '<script>alert("Message sent successfully!");</script>';
        echo '<script>window.location.href = "index.html";</script>';
    } else {
        // Email sending failed
        echo '<script>alert("Email sending failed.");</script>';
    }
}
?>