android_income_sms_gateway_webhook
android_income_sms_gateway_webhook copied to clipboard
php json empty post issue
Took me a while to understand why my post var was empty, it is because of the json type! I think would be nice to add in the doc that you have to decode it manually in php script. Or include an example:
<?php
$_POST = json_decode(file_get_contents('php://input'), true);
$text = "N/A";
if(isset($_POST["text"])){
$text = $_POST["text"];
}
$from = "N/A";
if(isset($_POST["from"])){
$from = $_POST["from"];
}
mail ( "[email protected]", "from ".$from, $text);
echo "OK";
?>