html - How to use HTTP_REFERER in PHP
one text
Solution:
https://stackoverflow.com/a/60288899/7044855
Referrer isn't always set. You can set HTTP headers manually if you're testing using curl/postman/etc, but not if you were testing by simply hitting your script in a browser.
Using this key/value combination you should see the following output
<?php
$referer = $_SERVER['HTTP_REFERER'];
echo $referer;
// https://google.com
Source