check current path in using comtext php
First off, there could be manly causes to this, most likely permissions but if you're saying these are correct I'd look at the caching.

From how you wrote the question it suggested you're using the php filter (I'd advise against the use of this really and opt for module development). If you are doing this within a module I would check that the hook you are using is the correct one and is being fired.

As for your code, check_plain isn't needed here because you're not outputting the uri to the browser only checking against it.

I would use the inbuilt drupal functions to do this though either way.


current_path() - https://api.drupal.org/api/drupal/includes!path.inc/function/current_path/7
drupal_get_query_parameters() - https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_get_query_parameters/7


Take note, the current_path() function returns the internal path for the url, not the friendly one, 'node/1' instead of 'this-url'.

$query = drupal_get_query_parameters();
return current_path() === 'mypath' &amp;&amp; $query['key_of_query'] === '123';