How do I set an absolute include path in PHP?

后端 未结 10 1908
别那么骄傲
别那么骄傲 2020-12-04 11:32

In HTML, I can find a file starting from the web server\'s root folder by beginning the filepath with "/". Like:

/images/some_image         


        
10条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-04 11:53

    Not directly answering your question but something to remember:

    When using includes with allow_url_include on in your ini beware that, when accessing sessions from included files, if from a script you include one file using an absolute file reference and then include a second file from on your local server using a url file reference that they have different variable scope and the same session will not be seen from both included files. The original session won't be seen from the url included file.

    from: http://us2.php.net/manual/en/function.include.php#84052

提交回复
热议问题