>我正在尝试在 url 中传递变量但没有成功。
在Drupal中,我有一个页面:
require_once 'uploaded_files/individual_funds.php?id=8';
但是我收到一个错误:致命错误:require_once() [function.require]:需要打开失败的'uploaded_files/individual_funds.php?id=8
我知道Drupal正在专门寻找这个网址,以及为什么它不起作用。 但是我需要将变量传递到该页面中。有没有解决方法。
只能包含文件。您不能通过 require
调用它们,但您可以执行以下操作:
$_GET['id'] = 8';
require_once 'uploaded_files/individual_funds.php';
这将为所需文件中的函数设置 get id
参数。