PHP - include() file not working when variables are put in url?

后端 未结 5 1659
梦毁少年i
梦毁少年i 2021-01-13 18:28

In PHP I\'ve build a webpage that uses include() for loading parts of the website. However, I now ran into something like a problem: When I use an url like: data-openo

5条回答
  •  逝去的感伤
    2021-01-13 19:22

    The include() function does not access the file via HTTP, it accesses the file through the OS's own file system. So GET variables are not counted. (as they are not part of the file name).

    In layman's terms, the point of include is to "copy/paste" all the contents on one file to another on the file, so that you don't have one gigantic file, but a few smaller, more maintainable ones.

提交回复
热议问题