PHP - include a php file and also send query parameters

后端 未结 13 1136
长发绾君心
长发绾君心 2020-11-27 03:46

I have to show a page from my php script based on certain conditions. I have an if condition and am doing an \"include\" if the condition is satisfied.

if(co         


        
13条回答
  •  有刺的猬
    2020-11-27 04:40

    You could do something like this to achieve the effect you are after:

    $_GET['id']=$somevar;
    include('myFile.php');
    

    However, it sounds like you are using this include like some kind of function call (you mention calling it repeatedly with different arguments).

    In this case, why not turn it into a regular function, included once and called multiple times?

提交回复
热议问题