Hey,
I'm trying to make a script load based on the domain name of the referer of the document, if any.
I already have this in place, which also works:
if (stristr($_SERVER["HTTP_REFERER"],"right-domain")) {run script} else {blocked}
But I feel it is insecure, as anyone could simply have "http://wrong-domain/right-domain/stuff/", and gain access to the script.
So my question, is there a way to only grab the domain of the referer without depending on the whole variable?
Thanks in advance. 🙂