我试图在网址中传递变量,但没有成功。
在 Drupal 中,我有一个页面:
require_once 'uploaded_files/individual_funds.php?id=8';
但我收到错误: fatal error :require_once() [function.require]: 无法打开所需的'uploaded_files/individual_funds.php?id=8
我知道 Drupal 正在专门寻找这个 url,这也是它不起作用的原因。但我需要将变量传递到该页面。 有解决办法吗?
最佳答案
您只能包含文件。您无法通过 require
调用它们,但您可以执行以下操作:
$_GET['id'] = 8';
require_once 'uploaded_files/individual_funds.php';
这将为所需文件中的函数设置 get id
参数。
关于php - 在 URL 中传递变量 Drupal 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13608753/