如何调用 html 目录之外的脚本?
How can I call a script which is out of html directory?
这是我的目录结构:
/var
/www
myscript.php
/html
index.php
目前,index.php
是空的。我想知道,我应该在里面写些什么才能通过 http 请求调用 myscript.php
脚本?
这通常有效:
<?php // index.php : url is /html/index.php
include('../myscript.php);
如果您想做相反的事情:
<?php // myscript.php : url is /myscript.php
include('html/index.php);
这是我的目录结构:
/var
/www
myscript.php
/html
index.php
目前,index.php
是空的。我想知道,我应该在里面写些什么才能通过 http 请求调用 myscript.php
脚本?
这通常有效:
<?php // index.php : url is /html/index.php
include('../myscript.php);
如果您想做相反的事情:
<?php // myscript.php : url is /myscript.php
include('html/index.php);