PHP, getting variable from another php-file

前端 未结 4 590
遥遥无期
遥遥无期 2020-11-27 04:18

So I wonder if it is possible to get a variable from a specific php-file when the variable-name is used in multiple php-file. An example is this:



        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 04:59

    You could also use a session for passing small bits of info. You will need to have session_start(); at the top of the PHP pages that use the session else the variables will not be accessable

    page1.php

    
    Go to the other page
    

    page2.php

    
    

提交回复
热议问题