"."You got the DANM secret wrong. - ask around."; }else{ $qs = $qs . "secret=" . urlencode($_REQUEST['secret']) . "&"; } if (! $_REQUEST['message']){ $notification = "You did not submit a message."; } if (! $_REQUEST['created_by'] ){ $notification = $notification."
"."Please tell us your name."; }else{ $qs = $qs . "created_by=" . urlencode($_REQUEST['created_by']) . "&"; } # if there is no notification value set, then all is well and we get to add a new message to the database if (! $notification){ # it looks like we should add a post to the database. $query = "INSERT INTO messages SET message = '" . $_REQUEST['message'] . "', created_by = '" . $_REQUEST['created_by'] . "'"; if (! mysql_query($query)) { $notification = "Dude, some horrible database thing happened."; } } # do we need to tell the user that something bad happened? if ($notification){ # okay, there is now a notification and we need to tell the user $qs = $qs . "notification=" . urlencode($notification); } header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Location: view_messages.php?".$qs); mysql_close($conn); ?>