gasguirre gasguirre - 3 months ago 9
PHP Question

allow only urls that have a parameter in

so, I have a

that redirects to another doing a
Double Meta Refresh (cleans referer)
and I would like to only allow to see the
second url
when the
url comes with a parameter

the current setup is:

urlA.php --DMR---> urlB.php

I want to users to be able to see
urlB only if they come from urlA
, but as the referrer is cleaned in the middle I don't think I can check via referrer in
for example.

so I was thinking on checking on a parameter, so urlB is only accessible when a special parameter comes, something like:

urlA.php ----DMR---> urlB.php ///NOT POSSIBLE

urlA.php?key=xxxx ----DMR---> urlB.php /// POSSIBLE

thank you in advance.


Surely if you are passing a GET parameter you can use:

if(!isset($_GET["key"]) || $_GET["key"] !== "urlA.php"){
   die("you must come from a certain page" );
  echo "You came from the right place";