I have a website (https://example.com/) that has a form on it. The form uses POST to connect to another website (https://app.example.com/). The other website (https://app.example.com/), connects to a mysql database. I am getting fake inputs on the database. All of the fake inputs do not have referers. I added this code to the other website (https://app.example.com/) to fix this problem,
$allowed_host = 'example.com';
$referer = $_SERVER['HTTP_REFERER'];
$hacker_page = 'https://app.example.com/hacker.php';
$host = parse_url($referer, PHP_URL_HOST);
if($referer == ''){
header("Location: $hacker_page");
}
if(!(substr($host, 0 - strlen($allowed_host)) == $allowed_host)) {
header("Location: $hacker_page");
}
but I am still getting fake inputs...