How can the source of a frame be accessed in PHP?

To access the source of a frame in PHP, you can use the $_SERVER['HTTP_REFERER'] variable. This variable contains the URL of the page that referred the user to the current page. By accessing this variable, you can determine the source of the frame and take appropriate actions based on it.

$source = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'Direct access';
echo $source;