$bf, "bannedmanually" => false ); file_put_contents($bansfp, json_encode($ipbans, JSON_PRETTY_PRINT)); } else if(!$_POST["name"]) { $returnCode = "noname"; } else if(!$_POST["message"]) { $returnCode = "nomessage"; } else if( $_POST["website"] and !preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i", $_POST["website"]) or $_POST["cool"] and !preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i", $_POST["cool"]) ) { $returnCode = "invalidlink"; } else { date_default_timezone_set("America/Edmonton"); $modstatus = $defaultmodstatus; $bannedwords = json_decode(file_get_contents($datadir."bannedwords.json")); $bwspotted = false; foreach($bannedwords as $word) { if(preg_grep($word, $_POST)) { $modstatus = 0; } } if(isset($ipbans[$sourceip]) and $ipbans[$sourceip]["botfails"] >= 5) { $modstatus = 0; } if($modstatus < 1) { $returnCode = "review"; } $currentPost = array( "entry" => $_POST["entry"], "sourceip" => $sourceip, "date" => time(), "name" => $_POST["name"], "message" => $_POST["message"], "found" => $_POST["found"], "website" => $_POST["website"], "cool" => $_POST["cool"], "reply" => "", "modstatus" => $modstatus ); $filename = $datadir."posts.json"; $extantPosts = json_decode(file_get_contents($filename)); array_push($extantPosts, $currentPost); file_put_contents($filename, json_encode($extantPosts, JSON_PRETTY_PRINT)); } } $referrer = preg_replace("/\?.*/", "", $_SERVER['HTTP_REFERER']); header("Location: $referrer?return=$returnCode"); ?>
Your post has been submitted! It's weird that you're seeing this page though. Maybe your browser can't process location headers? At any rate, click here"; ?> to get where you're supposed to be right now.