diff --git a/sender.php b/sender.php index f62c4ad..83f7c1c 100644 --- a/sender.php +++ b/sender.php @@ -10,9 +10,9 @@ use PHPMailer\PHPMailer\Exception; $mailer = new PHPMailer(true); try { - if (!$_POST || !$data=$_POST["data"]) throw new Exception("There is nothing here."); + if (!$_POST) throw new Exception("There is nothing here."); - $json = json_decode($data, true); + $json = json_decode(file_get_contents('php://input')); if (!$json["key"]) throw new Exception("What's the code word?");