dourong8495 2018-04-12 16:26
浏览 28
已采纳

打开/关闭PHP使超全局数组元素可用作全局变量

$_SESSION['myvar'] becomes available as $myvar after a session_start() call. $_POST['myvar'] becomes available as $myvar after a form is posted.

I find the above behavior with the PHP installation/configuration on one server, but not on another server. How do I query whether the server is configured as such, and how do I configure the installation to change this behavior? I just can't find anything about this in php.net or elsewhere.

  • 写回答

1条回答 默认 最新

  • duan20081202 2018-04-12 16:30
    关注

    This can be turned on via register_globals in your php.ini file. However this is deprecated as of 5.3. See the docs.

    Warning This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?