Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="col-md-7 contact-form wow animated fadeInLeft">
- <?php
- $alert = function($type, $message) {
- return "
- <div class=\"alert alert-$type\" role=\"alert\">$message</div>
- ";
- };
- if(isset($_POST['send'])) {
- $to = 'bok@serwer.pl'; // na jaki adres ma przyjsc wiadomosc
- $from = @$_POST['email'];
- $name = @$_POST['name'];
- $subject = "Wiadomość z formularza od $name.";
- $content = @$_POST['message'];
- $header = "From: $from \nContent-Type:" .
- ' text/plain;charset="iso-8859-2"' .
- "\nContent-Transfer-Encoding: 8bit";
- if (empty($from)) {
- echo $alert("info", "Podaj adres email.");
- } elseif (empty($name)) {
- echo $alert("info", "Podaj swoje imię.");
- } elseif (!mail($to, $subject, $content, $header)) {
- echo $alert("danger", "Nie można wysłać wiadomości.");
- } else {
- echo $alert("success", "Widomość została wysłana.");
- }
- }
- ?>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- <div class="input-field">
- <input type="text" name="name" class="form-control" placeholder="Twoje imię...">
- </div>
- <div class="input-field">
- <input type="email" name="email" class="form-control" placeholder="Twój e-mail...">
- </div>
- <div class="input-field">
- <textarea name="message" class="form-control" placeholder="Twoja wiadomość..."></textarea>
- </div>
- <button type="submit" name="send" id="submit" class="btn btn-blue btn-effect">Wyślij</button>
- </form>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement