0

有一个 php 项目fully core php。现在我的工作是改变一些风格问题。所以我只是用数据库下载了所有文件。我刚刚通过本地主机(LAMP)配置了所有数据库名称、用户名、密码。当我浏览该页面时,它正在显示该页面,但它存在一些错误。它显示错误,例如

Notice: Undefined variable: _session_register in path to the folder/session.php on line 8 
Notice: Undefined variable: _session_register in path to the folder/session.php on line 9
Notice: Undefined variable: _session_register in path to the folder/session.php on line 10 
Notice: Undefined variable: _session_register in path to the folder/session.php on line 11 
Notice: Undefined variable: _session_register in path to the folder/session.php on line 12 
Notice: Undefined variable: _session_register in path to the folder/session.php on line 13

session.php 的代码是这样的

<?php
$_SESSION['example']="yes"; 
ini_set("url_rewriter.tags","");
ini_set('session.use_trans_sid', 0);
ini_set("session.cookie_domain", ".localhost");
session_start();
ob_start();
$_session_register["easb2b_username"];
$_session_register["easb2b_userid"];
$_session_register["easb2b_memtype"];
$_session_register["easb2b_adv_id"];
$_session_register["easb2b_adv_email"];
$_session_register["lang"];
?>

所以有人可以告诉我如何解决这个问题。该项目有大约数千个文件。所以真的很难浏览所有文件并检查它们。任何帮助和建议都将是非常可观的。谢谢....

4

1 回答 1

0
<?php
// Use of session_register() is deprecated
$new_sessionvar = "Some value.";
session_register("new_sessionvar");

但是你仍然可以使用

session_start();
$_SESSION['new_sessionvar'] = "Some value"

为了使用它,您需要register_global打开php.ini

请注意,我在session_start()初始化上方有函数。在您的代码中,您可能希望将其添加到脚本的顶部,以防止PHP 消息已发送标头

于 2013-02-12T04:57:04.630 回答