if (isset($_POST['submit'])) {
$result = $_POST["input"];
}
else {
echo "ERROR";
}
fetch('https://jsonplaceholder.typicode.com/<?php echo "$result" ?>')
.then(response => response.json())
.then(json => console.log(json));
document.write
он выводит {object Object}