test code

This commit is contained in:
Filip Rojek 2023-04-16 12:37:28 +02:00
parent 79331ce222
commit 1c5abc4834

View File

@ -37,6 +37,8 @@
</script> </script>
<?php <?php
ini_set('log_errors', 1);
if(isset($_POST['email']) && isset($_POST['message'])) { if(isset($_POST['email']) && isset($_POST['message'])) {
$email = $_POST['email']; $email = $_POST['email'];
$message = $_POST['message']; $message = $_POST['message'];
@ -48,12 +50,10 @@ if(isset($_POST['email']) && isset($_POST['message'])) {
if($m->send()) { if($m->send()) {
console_log("zprava odeslana"); console_log("zprava odeslana");
console_log("zprava:");
console_log($m);
header('Location: /?sent=true'); header('Location: /?sent=true');
} else { } else {
console_log("zprava neodeslana"); error_log("Message wasn't sent");
console_log($m); error_log($m);
echo "<p>Něco se nepovedlo, zkuste to znovu... :(</p>"; echo "<p>Něco se nepovedlo, zkuste to znovu... :(</p>";
echo "<a href='/'>Zpět</a>"; echo "<a href='/'>Zpět</a>";
} }