If I have a form in a view to submit a field "id" and the following code in "file.php" to receive it, how should I encode and send it?
"file.php"
$body = json_decode(file_get_contents("php://input"), true);
echo $body['id'];
"in the view"
<form action="file.php" method="post">
<input type="number" name="id" />
<input type="submit" />
</form>