Koleżanki, Koledzy!
Pomóżcie mi proszę odnaleźć błąd w skrypcie, formularz nie działa (wiadomości nie dochodzą).
HTML:
<div class="col-md-5 col-sm-5">
<div class="vertical-registration-form"> <div class="colored-line"> <h3>bezpłatny kontakt
</h3> <form class="registration-form" id="register" role="form"> <input class="form-control input-box" id="name" type="text" name="name" placeholder="Imię i nazwisko"> <input class="form-control input-box" id="email" type="email" name="email" placeholder="E-mail"> <input class="form-control input-box" id="phone-number" type="text" name="phone-number" placeholder="Numer telefonu"> <button class="btn standard-button" type="submit" id="submit" name="submit">Wyślij
</button>
PHP:
<?php
// Email Submit
// Note: filter_var() requires PHP >= 5.2.0
if ( isset($_POST['email']) && isset($_POST['name']) && isset($_POST['subject']) && isset($_POST['message']) && filter_var
($_POST['email'], FILTER_VALIDATE_EMAIL
) ) {
// detect & prevent header injections
$test = "/(content-type|bcc:|cc:|to:)/i";
foreach ( $_POST as $key => $val ) {
}
}
$headers = 'From: ' . $_POST["name"] . '<' . $_POST["email"] . '>' . "\r\n" .
'Reply-To: ' . $_POST["email"] . "\r\n" .
//
mail( "MÓJ.ADRES.MAILOWY", $_POST['subject'], $_POST['message'], $headers );
// ^
// Replace with your email
}
?>