3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE> <html> <body> <?php $from = 'jjacobs@valdosta.edu'; $subject=$_POST['subject']; $text=$_POST['libnews']; if ((empty($subject) &&empty($text)) echo 'You forgot the email subject and body text.<br/>'; } if ((empty($subject) && (!empty($text) echo 'You forgot the email subject.<br/>'; } if ((empty($subject)) && empty($text) { echo 'You forgot the email body text.<br/>': } if ((empty($subject)) && (!empty($text)) { $dbc=mysqli_conntect('localhost', 'root', 'root', 'astwo_jacobs') error or die ('Error connection to MySQL server.'); $query = "SELECT * FROM email_list"; $result = mysqli_query($dbc, $query) or die('Error querying database.'); while ($row = mysqli_fetch_array($resu{)) $to = $row['email']; $first_name = $row['first_name']; $last_name = $row['last_name']; $msg = "Dear $first_name $last_name,\n$text"; mail($to, $subject, $msg, 'From:' . $from); echo 'Email sent to: ' . $to . '<br />'; } mysqli_close($dbc); ?> <p><a href= "http://localhost/asthree_sendemail.html>Back to the form</a></p> </body> </html>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
Parse error: syntax error, unexpected 'echo' (T_ECHO) in /in/h3H8p on line 11
Process exited with code 255.

preferences:
159.08 ms | 1399 KiB | 36 Q