Hello.

Is there some function or even 'include_once' where the path can include a query string so that it goes directly to a certain area of the included file and proceed e.g. to a $_REQUEST['do']?

I tried adding the '?do=' to the file name and it gave an error message that it couldn't find the file.

Thanks in advance.

EDIT: I found an example and it showed the full HTTP path was needed. Thanks anyway.

    Remember that when you include a file with include() or require(), it has access to all global variables from the file where you include it in.

    So for your specific example, just set $_REQUEST['do']= somevalue and include the file.

      Just to clarify what void_function said: the included file will have access to variables in the including script's global scope if the "include()" statement is in the global scope, but if it's inside a function the included file will inherit only that function's scope.

        Thanks folks for your replies.

        I had the following in a function:

        function testing()
        {
        $_REQUEST['do']=...;

        include('./filename.php');

        print "Include VAR: " . $var . "<br /><br />\n";

        return;
        }

        I didn't get an error nor did the file seem to execute since I didn't get any results in the test print statement for one of the variables that should have been set within that included file. I'm not sure where to go with this other than cutting and pasting the code I'm after and getting the results that way... 😕

        Thanks again.

          Hey there. Your instructions work!

          I had an error in my file that did not generate a server error. I found it, fixed it and all is well!

          Thanks so very much, both of you!

          Take care.

            Write a Reply...