`
sdustyongz
  • 浏览: 84833 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

import_request_variables

    博客分类:
  • php
阅读更多
bool import_request_variables ( string $types [, string $prefix ] )
将 GET/POST/Cookie 变量导入到全局作用域中。如果你禁止了 register_globals,但又想用到一些全局变量,那么此函数就很有用。

你可以使用 types 参数指定需要导入的变量。可以用字母‘G’、‘P’和‘C’分别表示 GET、POST 和 Cookie。这些字母不区分大小写,所以你可以使用‘g’、‘p’和‘c’的任何组合。POST 包含了通过 POST 方法上传的文件信息。注意这些字母的顺序,当使用“gp”时,POST 变量将使用相同的名字覆盖 GET 变量。任何 GPC 以外的字母都将被忽略。

prefix 参数作为变量名的前缀,置于所有被导入到全局作用域的变量之前。所以如果你有个名为“userid”的 GET 变量,同时提供了“pref_”作为前缀,那么你将获得一个名为 $pref_userid 的全局变量。

如果你对导入其它全局变量(例如 SERVER 变量)感兴趣,请考虑使用 extract()。

Note:

虽然 prefix 参数是可选的,但如果不指定前缀,或者指定一个空字符串作为前缀,你将获得一个 E_NOTICE 级别的错误。使用默认错误报告级别是不显示注意(Notice)级别的错误的。

<?php
// 此处将导入 GET 和 POST 变量
// 使用“rvar_”作为前缀
import_request_variables("gP", "rvar_");

echo $rvar_foo;
?>
分享到:
评论

相关推荐

    PHP函数import_request_variables()用法分析_.docx

    PHP函数import_request_variables()用法分析_.docx

    PHP函数import_request_variables()用法分析

    import_request_variables 函数可以在 register_global = off 时,把 GET/POST/Cookie 变量导入全局作用域中。 描述 bool import_request_variables ( string types [, string prefix]) 将 GET/POST/Cookie 变量...

    BUUCTF-Web-Mark loves cat变量函数覆盖

    经常导致变量覆盖漏洞场景有:$使用不当,extract()函数使用不当,parse_str()函数使用不当,import_request_variables()使用不当,开启了全局变量注册等。 全局变量覆盖 extarct()变量覆盖 遍历初始化变量 ...

    php 高级应用 程序漏洞

    n import_request_variables()变量覆盖漏洞 n PHP5 Globals n 什么是magic_quotes_gpc n 哪些地方没有魔术引号的保护 n 变量的编码与解码 n 二次攻击 n 魔术引号带来的新的安全问题 n 变量key与魔术引号 n PHP中可能...

    高级PHP应用程序漏洞审核技术

    5.2.3 import_request_variables()变量覆盖漏洞 5.2.4 PHP5 Globals 5.3 magic_quotes_gpc与代码安全 5.3.1 什么是magic_quotes_gpc 5.3.2 哪些地方没有魔术引号的保护 5.3.3 变量的编码与解码 5.3.4 二次攻击 5.3.5...

    PHP特性(网友整理1)1

    1.1 基本弱类型漏洞 1.1.1 数组比较 3.1 $$的使用 3.4 import_request_variables函数 5.1 包含函数 1.1 基本弱

    pasc2at:高级PHP应用程序漏洞审核技术 by 80vul

    高级PHP应用程序漏洞审核技术前言传统的代码审计技术PHP版本与应用代码审计其他的因素与应用代码审计扩展我们的字典变量本身的key变量覆盖遍历初始化变量parse_str()变量覆盖漏洞import_request_variables()变量覆盖...

    基于FetchAPI封装的HTTPClientFetchHTTPClient.zip

    // Path variables support. client.get('users/{id}', { uriParams: { id: 1 } }).then(response =&gt; console.log(response.jsonData));预处理异步请求的中间件示例,从存储中异步读取accessToken,并...

    goamzpa:使用 Amazon Product API 的 Go 库

    戈姆斯帕 使用Amazon Product API 的BSD 许可库。 也是我的第一个Go项目。 目前它只支持ItemLookup 。 一切都可能改变,而且可能会改变,使用后果自负。 ... request := amzpa.NewRequest(accessK

    freemarker总结

    使用import指令导入库到模板中,Freemarker会为导入的库创建新的名字空间,并可以通过import指令中指定的散列变量访问库中的变量: &lt;#import "/lib/my_test.ftl" as my&gt; ${my.mail} ${mail} 输出结果...

    jxse-shell-2.5

    importfile Import an external file info display info about an jxta advertisement instjar Installs jar-files containing additional Shell commands join Instantiate and join peer group leave Resign from ...

    Beginning Python (2005).pdf

    xvii Contents Finishing Your Modules 154 Defining Module-Specific Errors 154 Choosing What to Export ...CGI’s Special Environment Variables 471 Accepting User Input through HTML Forms 473 The cgi ...

    hera::laptop:轻巧的GraphQL客户端

    import { hera } from 'hera-js' ; const { data } = await hera ( { options : { url : 'https://example.com' } , query : ` query { user(id: $id) { id name age } } ` , variables : { id : 1 ...

    python-graphql-client:在python中向graphQL服务器发出请求的简单模块

    Python GraphQL客户端用于向graphql服务器发出请求的简单程序包。...Create the query string and variables required for the request.query = """ query countryQuery($countryCode: String) { country(code

    python3.6.5参考手册 chm

    urllib.request urllib.robotparser venv warnings winreg winsound xmlrpc.client zipfile zlib Optimizations Build and C API Changes Other Improvements Deprecated New Keywords Deprecated ...

    获取jsp各种参数

    /** Creates a table showing the current value of each * of the standard CGI variables. * &lt;P&gt; * Taken from Core Servlets and JavaServer Pages * from Prentice Hall and Sun Microsystems Pres

    Bloodshed Dev-C++

    * When adding debugging symbols on request, remove "-s" option from linker * Compiling progress window * Environment options : "Show progress window" and "Auto-close progress window" * Bug fixes ...

    Git-2.21.0-64-bit.zip

    * "git request-pull" learned to warn when the ref we ask them to pull from in the local repository and in the published repository are different. * When creating a partial clone, the object ...

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....

Global site tag (gtag.js) - Google Analytics