gpt4 book ai didi

php - 在 URL 中传递变量 Drupal 7

转载 作者:行者123 更新时间:2023-11-29 14:10:16 25 4
gpt4 key购买 nike

我试图在网址中传递变量,但没有成功。

在 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com