我建立一个迷你型的CMS,但是当我尝试使用会话我得到这个错误:PHP会话功能说弃用
推荐使用:功能session_is_registered()在index.php文件已经过时上线4条,其中,我使用的代码是:
<?php
session_start(); //Start the session
define(ADMIN,$_SESSION['name']); //Get the user name from the previously registered super global variable
if(!session_is_registered("admin")){ //If session not registered
header("location:login.php"); // Redirect to login.php page
}
else //Continue to current page
header('Content-Type: text/html; charset=utf-8');
?>
它还说一些关于已经发出头......
[用于弃用session_is_registered替代]的可能重复(http://stackoverflow.com/questions/5286446/alternative-for-deprecated-session-已注册) – ManseUK
只需要一个[Google搜索](http://www.google.com/search?q=session_is_registered()+替代)即可找到[解决方案](http://stackoverflow.com/questions/) 2600905/PHP-替代到会话被登记)。所以。可能重复以及 – Havelock