session_start 在 cpanel 中无法正常工作 [英] session_start not working properly in cpanel

查看:45
本文介绍了session_start 在 cpanel 中无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

警告:session_start() [function.session-start]:无法发送会话缓存限制器 - 标头

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers

已发送(输出开始于/home/scalepro/public_html/Admin ........................实际上没有空格和输出,但仍然显示上述错误信息.

already sent (output started at /home/scalepro/public_html/Admin ............................. Actually there is no space and output but still showing the above error message.

代码如下:

<?php 
ob_start();session_start();
?>
<html>
<head>
</head>
<body>
<?php
require_once('../../Admin Panel/db.php');
if(isset($_POST['email']) && !empty($_POST['email']) && isset($_POST['password']) && !empty($_POST['password']))
{
 $email = $_POST['email'];
 $password = $_POST['password'];
 $query="SELECT RemoteEmployeeFullName, RemoteEmployeeEmail, RemoteEmployeePassword FROM remoteemployees WHERE RemoteEmployeeEmail='".$email."' AND RemoteEmployeePassword='".$password."'";
 $queryrun=$connection->query($query);
       if($queryrun->num_rows > 0)
       {
           $_SESSION['email']=$RemoteEmployeeFullName;
           echo '<META HTTP-EQUIV="Refresh" Content="0; URL=REPLists.php">';    
           exit();
       }
       else
       {
           echo 'Email: <b>'.$email. '</b> or Password <b>'. $password.'</b> Is Not Typed Correctly Try Again Please!.';
           echo '<META HTTP-EQUIV="Refresh" Content="5; URL= ../../spd/myaccount.php">';
           exit();
       }

}
else
{
    echo '<META HTTP-EQUIV="Refresh" Content="5; URL= home/scalepro/public_html/spd/myaccount.php">';
    exit();
}?>
</body>
</html>

推荐答案

确保在这些行之前没有任何内容输出到浏览器,并从该代码中删除任何不常用的空格.

Make sure you have nothing that outputs to the browser before those lines and delete any unessasary whitespace from that code up.

这篇关于session_start 在 cpanel 中无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆