开发者

How do I delete a member of $_REQUEST?

开发者 https://www.devze.com 2023-01-16 16:00 出处:网络
$_REQUEST[\'delete_me\']; Array ( [action] => test [city_name] => Orlando [delete_me] => -
$_REQUEST['delete_me'];

Array ( 
 [action] => test
 [city_name] => Orlando 
 [delete_me] => - 
);
开发者_开发百科

Can I just delete it or will setting it to $_REQUEST['delete_me'] = ""; do the trick?


unset($_REQUEST['delete_me']);

See the PHP manual for more information about unset.


In addition to what halfdan said, you should probably be using $_GET or $_POST or equivalent, unless you really do require it to be that ambiguous.

Taking values from $_REQUEST can make XSS that much easier... when you want POST values and a malicious user just appends them to a query string.

0

精彩评论

暂无评论...
验证码 换一张
取 消