I am working on a contact form that works perfectly, but I would like to have an image upload feature so that the image is sent with the message as an attachment to the e-mail I specify. Here is my code:
<form method="post" action="contact.php">
            <label>Name</label>
            <input name="name" type="text" placeholder="">
            <label>Email</label>
            <input name="email" type="email" placeholder="">
            <label>message</label>
            <textarea name="message" placeholder=""></textarea>
            <label>How much is 2+2? (Anti-spam)</label>
            <input name="human" type="number" placeholder=""><br>
            <input id="submit" name="submit" type="submit" value="Send message!" class="button_verde"><br><br>
            <?php
                $name = $_POST['name'];
                $email = $_POST['email'];
                $message = $_POST['message'];
                $from = 'Website'; 
                $to = 'mail@mail.com'; 
                $subject = 'New message';
                $human = $_POST['human'];
                $headers = "MIME-Version: 1.0" . PHP_EOL;
                $headers .= "From: $from <$email> ". PHP_EOL;
                $headers .= "Content-type: text/html;charset=UTF-8 ". PHP_EOL;
                $name = str_replace( '[at]','@', $name);
                $message = str_replace( '[at]','@', $message);
                $body = "<strong>Från:</strong> $name\n <br><strong>E-post:</strong> $email\n <br><strong>Meddelandet:</strong>\n <br>$message";
                if ($_POST['submit']) {
                if ($name != '' && filter_var($email, FILTER_VALIDATE_EMAIL)) {
                    if ($human == '4') {                 
                        if (mail ($to, $subject, $body, $headers)) { 
                        echo '<div data-alert class="alert-box success radius">
                                Message sent!<a href="#" class="close">×</a>
                              </div>';
                    } else { 
                        echo '<div data-alert class="alert-box warning round">
                                Try again!<a href="#" class="close">×</a>
                              </div>'; 
                    } 
                } else if ($_POST['submit'] && $human != '4') {
                    echo '<div data-alert class="alert-box warning round">
                            Wrong answer!<a href="#" class="close">×</a>
                          </div>';
                }
                } else {
                    echo '<div data-alert class="alert-box warning round">
                            Missing obligatory fields!<a href="#" class="close">×</a>
                          </div>';
                }
            }
            ?>
        </form>
My question is, how can I add an image upload to this form?