如何获取该变量

xujianxie 2003-02-21 10:26:58
如果php.ini 文件中设置Register Globals=off
这样穿入 的变量该如何获取 register_submit.php?id=3

在 register_submit.php这个文件中,该如何访问变量id
...全文
55 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
goodname 2003-02-21
  • 打赏
  • 举报
回复
$_GET['id'];
goodname 2003-02-21
  • 打赏
  • 举报
回复
$_GET["id"];
xuzuning 2003-02-21
  • 打赏
  • 举报
回复
$_GET["id"]
建议先看一下FAQ
ashchen 2003-02-21
  • 打赏
  • 举报
回复
这个问题已经被问了一万零一遍了
打开php.ini
; - register_globals = Off [Security, Performance]
; Global variables are no longer registered for input data (POST, GET, cookies,
; environment and other server variables). Instead of using $foo, you must use
; you can use $_REQUEST["foo"] (includes any variable that arrives through the
; request, namely, POST, GET and cookie variables), or use one of the specific
; $_GET["foo"], $_POST["foo"], $_COOKIE["foo"] or $_FILES["foo"], depending
; on where the input originates. Also, you can look at the
; import_request_variables() function.
; Note that register_globals is going to be depracated (i.e., turned off by
; default) in the next version of PHP, because it often leads to security bugs.
; Read http://php.net/manual/en/security.registerglobals.php for further
; information.
zkq 2003-02-21
  • 打赏
  • 举报
回复
$_GET['vars']
or
$_POST['vars']
or
$_SESSION['vars']
Croatia 2003-02-21
  • 打赏
  • 举报
回复
$_Request['id'];

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧