Kod działa ok, ale bez zapamiętywania danych w formularzu.
<?php $from = 'edward@zrobzemnieelvisa.com'; $subject = $_POST['subject']; $text = $_POST['elvismail']; $output_form = false; // Wiadomo, że pola $subject i $text są puste. $output_form = true; } $output_form = true; } $output_form = true; } } else { $output_form = true; } $dbc = mysqli_connect('data.zrobzemnieelvisa.com', 'edward', 'theking', 'elvis_store') $query = "SELECT * FROM email_list"; $result = mysqli_query($dbc, $query) while ($row = mysqli_fetch_array($result)){ $to = $row['email']; $first_name = $row['first_name']; $last_name = $row['last_name']; $msg = "Drogi $first_name $last_name,\n$text"; } mysqli_close($dbc); } if ($output_form) { ?>
}
Ale jak wpiszę:
To pojawiają się komunikaty:
Notice: Undefined variable: subject in head first-projekty/rozdzial4/moj/sendemail.php on line 70
Notice: Undefined variable: text in /head first-projekty/rozdzial4/moj/sendemail.php on line 72
Czemu tak jest? Co oznaczają?