placing php script outside website root

后端 未结 3 542
说谎
说谎 2021-01-01 04:46

how would i a)include a php script that is outside the web root (would it really be just a simple ../file.php), b)post form data to a php script outside the web root. I\'m l

3条回答
  •  执笔经年
    2021-01-01 05:34

    A) if your web root is /www/myapp/public_html then your public_html/index.php could include scripts outside the web root by doing

    require '../includefolder/script.php"
    

    B) You can't post data directly to scripts outside the web root. The whole point of moving them there is so that there is no direct access to them; everything must pass along to them from your accessible scripts which are exposed in your web root.

提交回复
热议问题