在PHP中读取请求的向后兼容性(Backwards compability in reading requests in PHP)

编程入门 行业动态 更新时间:2024-10-22 23:15:43
在PHP中读取请求的向后兼容性(Backwards compability in reading requests in PHP)

我对Web开发很有经验,但不熟悉PHP。 因此,我现在面临的挑战是,我即将将旧的PHP解决方案迁移到仅支持PHP 5.2的服务器。+。 整个解决方案是使用$id -style来读取请求而不是$_REQUEST['id']或$_GET..., $_POST...

我想知道这种类型的编码是否不再受支持,或者我是否遗漏了这些内容。 我移动解决方案后,它无法正常工作。 变量将为空/空。

有没有一种简单的方法可以解决这个问题,还是我必须重写?

非常感谢您花时间提供帮助。

I am experienced with web development, but not with PHP. My challenge now is therefore that I am about to move an older PHP solution to a server only supporting PHP 5.2.+. The whole solution is using a $id - style to read the request instead of $_REQUEST['id'] or the $_GET..., $_POST...

I wonder if this type of coding is not longer supported, or if there is something I have missed here. After I moved the solution it is not working. The variable will be blank/empty.

Is there an easy way to solve this, or do I have to rewrite?

Thank you very much if you take the time to help.

最满意答案

旧版本在php.ini中使用Register_globals = on接缝

阅读它

http://www.peoplecnc.com/register_globals_off.html

不推荐使用它,默认情况下在php5中关闭

您可以通过创建名为.htaccess的文件来覆盖它并将其放入其中:

php_value register_globals 1

或者将这一行放在脚本的头部(在PHP 5.3.0中弃用。将来不会删除这个不推荐使用的功能。)

ini_set('register_globals', 'on');

但不推荐,因为您可以在链接中阅读。

its seam that the older version use Register_globals = on in php.ini

read on it

http://www.peoplecnc.com/register_globals_off.html

its not recommended to use it , and in php5 is off by default,

you can override it by create a file named .htaccess and put this into it:

php_value register_globals 1

or by put this line in the head of the script (Depreciated in PHP 5.3.0. This deprecated feature will certainly be removed in the future.)

ini_set('register_globals', 'on');

but is not recommended , as you can read in the link.

更多推荐

本文发布于:2023-07-24 10:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1245000.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:兼容性   PHP   compability   requests   reading

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!