PHP 中的无效参数

2024-01-04

当我在 Wamp 中运行脚本时,我收到以下第 17 行和第 21 行的警告通知。这告诉我什么以及可以/应该做什么来解决该问题?

Warning:为 C:\wamp\www\eCardScript\ecard_lib.php 中的 foreach() 提供的参数无效line 17 *Warning:* 为 C:\wamp\www\eCardScript\ecard_lib.php 中的 foreach() 提供的参数无效line 21

<?php
include('htmlMimeMail.php');

function getPostGetVars() {
  global $HTTP_POST_VARS,$HTTP_GET_VARS;
  foreach ($HTTP_POST_VARS as $key => $value) { // This is Line 17
    global $$key;
    $$key = $value;
  }
  foreach ($HTTP_GET_VARS as $key => $value) {  // This is Line 21
    global $$key;
    $$key = $value;
  }
}
?>

Use $_GET and $_POST反而。

http://php.net/manual/en/language.variables.predefined.php http://php.net/manual/en/language.variables.predefined.php

从 PHP 5.0.3 开始,默认情况下禁用长预定义数组,例如 HTTP_GET_VARS。为了向后兼容,您可以在 php.ini 中启用它们......

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

PHP 中的无效参数 的相关文章