PHP - include a php file and also send query parameters

后端 未结 13 1222
长发绾君心
长发绾君心 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:23

    An include is just like a code insertion. You get in your included code the exact same variables you have in your base code. So you can do this in your main file :

    
    

    And in "myFile.php" :

    
    

    This will output :

    My id is 12345 !

提交回复
热议问题