Generation

generate functionMon, 06 Feb 2023

write a php function to check if it's called by a domain from the whitelist, it will shows its content

//php function check_domain($domain) { $domains = ['google.com', 'yahoo.com']; foreach ($domains as $one) { if (strpos($domain, $one) !== false) { return true; } } return false; } if (check_domain($_SERVER['HTTP_REFERER'])) { //show content }

Questions about programming?Chat with your personal AI assistant