Skip to content

Instantly share code, notes, and snippets.

@andreblue
Created April 1, 2016 03:27
Show Gist options
  • Save andreblue/0abb83bcfe89cf8c9b024b88aa4b8dbb to your computer and use it in GitHub Desktop.
Save andreblue/0abb83bcfe89cf8c9b024b88aa4b8dbb to your computer and use it in GitHub Desktop.
<?php
$key = "PLACE A KEY HERE!!!!";
if($_SERVER['REQUEST_METHOD'] == "POST" || empty($_POST['key']) || $_POST['key'] != $key ){ die("Direct Access to this script is not allowed."); }
$reporttype = (empty($_POST["type"])) ? "" : strip_tags($_POST["type"]);
$from = (empty($_POST["from"])) ? "" : strip_tags($_POST["from"]);
$thereason = (empty($_POST["thereason"])) ? "" : strip_tags($_POST["thereason"]);
$person = (empty($_POST["reportonperson"])) ? "" : strip_tags($_POST["reportonperson"]);
$sip = (empty($_POST["serverip"])) ? "" : strip_tags($_POST["serverip"]);
$sport = (empty($_POST["serverport"])) ? "" : strip_tags($_POST["serverport"]);
$reportid = (empty($_POST["idreport"])) ? "" : strip_tags($_POST["idreport"]);
$date = (empty($_POST["thedate"])) ? "" : strip_tags($_POST["thedate"]);
$host = (empty($_POST["host"])) ? "" : strip_tags($_POST["host"]);
$emailto = (empty($_POST["sendto"])) ? "" : strip_tags($_POST["sendto"]);
$headers = "From: [email protected]\r\n";
$headers .= "Reply-To: [email protected]\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
if($reporttype=="Bug")
{
$subject = 'Automated Bug Report From: ' . $from;
$message = '<html><body>';
$message .= '<b>Reporting Player:</b> ' . $from . '<br />';
$message .= '<b>Bug Problem:</b> ' . $thereason . '<br />';
$message .= '<b>Reported on:</b> ' . $date . '<br />';
$message .= '<b>Report ID:</b> ' . $reportid . '<br />';
$message .= '<b>Server Name:</b> ' . $host . '<br />';
$message .= '<b>Server IP:</b> ' . $sip . ':' . $sport .'<br />';
$message .= "</body></html>";
}
else
{
$subject = 'Automated Player Report From: ' . $from;
$message = '<html><body>';
$message .= '<b>Reporting Player:</b> ' . $from . '<br />';
$message .= '<b>Reported Player:</b> ' . $person . '<br />';
$message .= '<b>Reported on:</b> ' . $date . '<br />';
$message .= '<b>Report Reason:</b> ' . $thereason . '<br />';
$message .= '<b>Report ID:</b> ' . $reportid . '<br />';
$message .= '<b>Server Name:</b> ' . $host . '<br />';
$message .= '<b>Server IP:</b> ' . $sip . ':' . $sport .'<br />';
$message .= "</body></html>";
}
mail($emailto, $subject, $message, $headers);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment