Witam
W moim formularzu szukam sposobu na zmianę sposobu wyświetlania powiadomienia o wysłaniu wiadomości. Wyświetlanie jest zapisane w kodzie który mam w dwóch miejscach - poniżej 2 fragmenty kodu
if(empty($errors)) { //send the email $to = $your_email; $subject="New form submission from website"; $from = $your_email; $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $body = "A user $name submitted the contact form website:\n"."Name: $name\n"."Email: $visitor_email \n"."Temat: $temat \n "."Message: \n "."$user_message\n"."Message sent from IP: $ip\n"; if (!mail($to, $subject, $body)) { die('ERROR'); } else { header('Location: thank-you.html'); } die();
oraz tutaj
//Read an HTML message body from an external file, convert referenced images to embedded, //convert HTML into a basic plain-text alternative body $mail->msgHTML($body); //Replace the plain text body with one created manually //send the message, check for errors if (!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; die(); } else { header('Location: thank-you.html'); }
W samym formularzu jest ukryty div wyświetlający ewentualne błędy
<td><!--ponizej php i div z bledami --><?php if(!empty($errors)){ echo "<p class='err'>".nl2br($errors)."</p>"; } ?><div id='contact_form_errorloc' class='err'></div>
Chciałbym aby poniżej diva z błędami ukazywał się też div z komunikatem o wysłaniu.
Może ktoś pomóc mi zamienić wyświetlanie strony thank-you.html i ewentualnego komunikatu o błędzie wysłania na wyświetlenie komunikatu w div.