PHP:$ _REQUEST没有显示get参数的值

I'm running into a strange problem where $_REQUEST is not showing the value of a parameter I am explicitly passing e.g.

http://example.com/strange.php?parName=1234

strange.php:

<?php 
$foo = $_REQUEST['parName'] ;
echo $foo ;
?>

I have looked in the Inspector and the Network tab actually shows the correct query string parameter.

I have carried out some tests.

in test.html:

<a href="request.php?parName=1234">link</a>

in request.php:

$foo = $_REQUEST['parName'];
echo $foo ;

I have also tried:

$foo = $_GET['parName'];
echo $foo ;

Both of which work.

Therefore thinking about the strange issue you are encountering, you will need carry out various checks:

  1. Is the query string getting passed? See $_SERVER["QUERY_STRING"]
  2. Check the request method $_SERVER["REQUEST_METHOD"]
  3. Check to see if the parName variable isset

    if(isset($_GET['parName'] )) {
    $foo = $_GET['parName'];
    echo $foo ;
    }
     else { "echo query string not received";
    }
    
  4. Check your error log to see what Apache is saying?
  5. What data is actually contained in the parName variable?

    var_dump($_REQUEST['parName'])
    

Once you've run all these tests, and the issue is still not resolved, please post your results so we can consider other possible paths to solving this problem.