• February 11, 2023
    <?php
    if(isset($_POST['submit'])){
        $to = "yourmail@mail.com"; // Replace with your own email address
        $name = $_POST['name'];
        $email = $_POST['email'];
        $message = $_POST['message'];
        $headers = "From: $name <$email>";
        
        // Check if all required fields are filled out
        if(empty($name) || empty($email) || empty($message)){
            header("Location: http://www.xxx.com");
            exit;
        }
        
        // Send the email
        mail($to, "New message from website", $message, $headers);
        echo "Message sent!";
    }
    ?>
    
    <form method="post" action="">
        <label>Name:</label>
        <input type="text" name="name" required>
        
        <label>Email:</label>
        <input type="email" name="email" required>
        
        <label>Message:</label>
        <textarea name="message" required></textarea>
        
        <input type="submit" name="submit" value="Send">
    </form>
    
    หรือ 
    
    <?php
    if(isset($_POST['submit'])){
        $to = "youremail@example.com"; // Replace with your own email address
        $name = $_POST['name'];
        $email = $_POST['email'];
        $message = $_POST['message'];
        $headers = "From: $name <$email>";
        
        // Check if all required fields are filled out
        if(empty($name) || empty($email) || empty($message)){
            header("Location: http://www.cymiz.com");
            exit;
        }
        
        // Send the email
        mail($to, "New message from website", $message, $headers);
        echo "Message sent!";
        exit;
    }
    ?>
    
    <form method="post" action="">
        <label>Name:</label>
        <input type="text" name="name" required>
        
        <label>Email:</label>
        <input type="email" name="email" required>
        
        <label>Message:</label>
        <textarea name="message" required></textarea>
        
        <input type="submit" name="submit" value="Send">
    </form>
    


เวอไนน์ไอคอร์ส

ประหยัดเวลากว่า 100 เท่า!






เวอไนน์เว็บไซต์⚡️
สร้างเว็บไซต์ ดูแลเว็บไซต์

Categories


Uncategorized