How can PHP be used to determine which site is currently loaded in a frame?
To determine which site is currently loaded in a frame using PHP, you can utilize the $_SERVER['HTTP_REFERER'] variable. This variable contains the URL of the page that referred the current page. By checking this variable, you can determine the site that is currently loaded in the frame.
$currentSite = $_SERVER['HTTP_REFERER'];
if ($currentSite == 'https://example.com/frame1.php') {
echo 'Frame 1 is currently loaded.';
} elseif ($currentSite == 'https://example.com/frame2.php') {
echo 'Frame 2 is currently loaded.';
} else {
echo 'Unknown frame is loaded.';
}