show something only when user comes from specific page at remote host?
I'm trying to achieve something discussed in a few other threads (such as here e.g.), but specific to a certain page refering, not just the host. Scenario: we host a quiz at an external site and want to open signup to users who successfully finished that particular quiz. What I found so far was s solution to check for the host:
$allowedsite = "thequizhost.com"; //allowed site url without http://
$allowedsite2 = "www.thequizhost.com"; //Type allowed domain with www. this time
$referer = $_SERVER['HTTP_REFERER'];
//Check if browser sends referrer url or not
if ($referer == "") { //If not, set referrer as allowed domain
$domain = $allowedsite;
} else {
$domain = parse_url($referer); //If yes, parse referrer
}
if($domain['host'] == $allowedsite || $domain['host'] == $allowedsite2) {
//proceed to allowed page
echo ("OK [signup_form id='2']");
} else {
//The referrer is not allowed site, we redirect to allowed home page or do something else
echo ("not OK");
}
but this basically allows anyone smart enough to just create a generic quiz at thequizhost.com and put a link to our signup page there.
How would I need to amend the above example to show the signup form only when the user is coming from thequizhost.com/ourspecificquiz.php ? https://www.thequizhost.com/the-quizzes/quizzing.php?title=our-specific-quiz-we-need-to-echek-forthen=someparameters=wedontneed ?
Thank you for whatever help you may be able to provide. Cheers - LX