在 PHP 中,我构建了一个网页,它使用 include() 来加载网站的某些部分。
然而,我现在遇到了一个类似的问题:
当我使用如下网址时:data-openov-storingen.php?type=actueel
它给了我这个错误:
Warning: include(data-storingen.php?type=actueel): failed to open stream: No such file or directory in blablabla
是否有可能在一个中传递 get 变量include()
url?
include
这种方式不会获取 URL,而是从文件系统中获取文件,因此不存在查询字符串之类的东西。
不过,你可以这样做:
$_GET['type'] = 'actueel';
include('data-storingen.php');
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)