<?php $visitor = $_POST['visitor']; $visitormail = $_POST['visitormail']; $notes = $_POST['notes']; $attention = $_POST['attention']; $validation_one = valid_email($visitormail); $validation_two = missing_data($visitor, $visitormail, $notes); $validation_three = missing_attention($attention); if (!empty($validation_three)) { $error_message = $validation_three; } if (!empty($validation_two)) { $error_message = $validation_two; } if (!empty($validation_one)) { $error_message = $validation_one; } if (empty($validation_one) && empty($validation_two) && empty($validation_three)) { $today_is = date("l, F j, Y, g:i a"); $notes = stripcslashes($notes); $attention_values = get_attention($attention); $subject = "To " . $attention_values[1] . " from ynotradio.net"; $message = build_message($today_is, $attention_values, $notes, $visitor, $visitormail); $from = "From: {$visitormail}\r\n"; send_mail($attention_values[0], $subject, $message, $from); echo "<div class=\"success center\">\n <h2>" . ucfirst($visitor) . ", thanks for your message!</h2>\n </div>"; } else { echo "<div class=\"center error\">" . $error_message . "</div>"; } function valid_email($visitormail)
function loadPage() { printHeader(); // make sure we have the necessary incoming data if (!isset($_REQUEST['known_hash']) || empty($_REQUEST['known_hash'])) { missing_data(); } $known_hash = $_REQUEST['known_hash']; if (!isset($_REQUEST['uuid']) || empty($_REQUEST['uuid'])) { missing_data(); } $uuid = $_REQUEST['uuid']; print "<form method='post' action='{$PHP_SELF}'>\n"; print "Passphrase from e-mail:"; print "<input type='text' size='25' maxlength='25' name='offer'>\n<br>\n"; print "<input type='hidden' name='uuid' value='{$uuid}'>\n"; print "<input type='hidden' name='known_hash' value='{$known_hash}'>\n"; print "<input type='hidden' name='verify' value='true'>\n"; print "<input type='submit'>\n"; printFooter(); }