PHP import_request_variable停止工作 [英] Php import_request_variable stopped working
问题描述
大家好,我的网页上出现以下错误:
Hey everyone I was getting the following error on my web page:
Fatal error: Call to undefined function import_request_variables() in /demo/conn.php on line 5
该行是:
import_request_variables('gp');
我删除了该行并收到以下错误:
I removed that line and received the following error:
Fatal error: Call to undefined function session_register() in /demo/verify.php on line 4
该行是:
session_register("userName");
我删除了那条线,现在一切似乎都工作正常.谁能告诉我这两条线发生了什么,是否应该用任何东西代替它们,或者我应该继续使用它们而不用.
I removed that line and everything appears to be working fine now. Can anyone tell me what was happening with those 2 lines and if I should replace them with anything or should I just continue on without them.
任何指导将不胜感激.
Any guidance would be greatly appreciated.
谢谢
推荐答案
我以前遇到过这个问题,我确实解决了这个问题,我在下面写完之后用之前的代码替换了代码,所以不要请勿使用import_request_variables在PHP 5.3中弃用,并在PHP 5.4中将其删除,如此处 http://uk3所述. php.net/import_request_variables ,以下是我遇到的问题的解决方法:
I had this problem from before, the work around that i did to fix it i replaced code before with code after that I've written below, so don't use import_request_variables it is deprecated in PHP 5.3 and in PHP 5.4 is removed as it is described in here http://uk3.php.net/import_request_variables, the following is the fix for the problem that i had:
之前的代码:
import_request_variables('p');
之后的代码(将上面的代码替换为下面的代码):
Code After (Replaced the code above with the code below):
extract($_GET, EXTR_PREFIX_ALL, 'p');
extract($_POST, EXTR_PREFIX_ALL, 'p');
这篇关于PHP import_request_variable停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!