简体   繁体   English

我如何检查 php 参数来自哪里?

[英]How do I check where the php parameter come from?I

I'm code reviewing php code and checked the parameters given with我正在审查 php 代码并检查了给出的参数

$params = $_GET;
var_dump($params);

//result
array(5) {
  ["date"]=>
  string(10) "2020-02-03"
  ["flag"]=>
  string(0) ""
  ["target"]=>
  string(1) "0"
  ["anorher_flag"]=>
  string(1) "1"
  ["url"]=>
  string(20) "foo/bar/sth/"
}

I want to check where that 'url' parameter is come from.我想检查“url”参数的来源。 Where was it passed from.从哪里传来的。 But the code/structure is too long and confusing to find where the 'url' is.. (and since url is very common name, over 300result search with 'url'..)但是代码/结构太长而且令人困惑,无法找到 'url' 的位置..(并且由于 url 是非常常见的名称,超过 300 次搜索结果使用 'url' ..)

Is there any useful command or function to check where specific parameter passed from?是否有任何有用的命令或函数来检查特定参数从哪里传递?

You can see from $_SERVER variable.您可以从$_SERVER变量中看到。

$_SERVER['SCRIPT_URI']

You will get the complete URL from where Data is Posted您将从发布数据的位置获得完整的 URL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM