Search code examples
phpgetglobal-variablesurl-parametersrequire-once

require_once strips or removes URL parameters


I'm passing a URL with parameters to an index.php page that contains 2 require_once functions calling template and config files that output the final page.

To elaborate:

URL with parameters /index.php?param=cat is passed to index.php which contains:

<?php

require_once('funnel_config.php');
require_once('template.php');
?>

this then loads the 2 files and in this process the URL parameter is stripped out.

Here's a screencast showing what I mean: http://screencast.com/t/gzEQFGQknV8M.

How can I ensure the url parameter persists when using require_once?

Is there an alternative method to achieve the same outcome?


Solution

  • Solved!

    URL parameters are NOT affected by loading files via require_once or include. Further investigation into the inner workings of this system identified a function within a php library called goToCleanURL(). Commented this function out and now URL parameters behave as expected.

    Thanks to the community for the advice that prompted me to dig a little deeper into the code.