Use raw JSON input
This commit is contained in:
parent
1dddd7b07e
commit
79e3fd93c2
1 changed files with 2 additions and 2 deletions
|
@ -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?");
|
||||
|
||||
|
|
Loading…
Reference in a new issue