Error logging in administrative panel - Session_start

Asked

Viewed 216 times

0

Hello, Guys I’m having a Session start error in which the same guy not logged in is able to access the panel

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/emanoelgomes/public_html/eba/paineldecontrole/includes/header.php:1) in /home/emanoelgomes/public_html/eba/paineldecontrole/includes/header.php on line 1

index php.

session_start(); 

@$Usuario = $_SESSION["Usuario"];
@$Senha   = $_SESSION["Senha"];

if (isset($Usuario) && isset($Senha)){

    header("Location: inicial.php");    
}

acaologin.php

require_once    '../includes/configuration.php';

$userName = $_POST["user-name"];
$userPass = $_POST["user-pass"];
$criptSen = hash("whirlpool", $userPass);
@$rediURL = $_GET["url"];

$SQL = mysql_query("SELECT Usuario, Senha FROM administradores WHERE Usuario='$userName' AND Senha='$criptSen' ");

if(mysql_num_rows($SQL) != 0){

    session_start();

    $_SESSION['Usuario'] = $userName;
    $_SESSION['Senha']   = $criptSen;

    if(isset($rediURL)){

      header("Location: ../$rediURL");

    } else {

         header("Location: ../inicial.php");

    }

} else {

    header("Location: ../index.php");

}

In the case when the user logs into index.php he will be redirected to loginacao.php, if everything is right he will go to the initial.php, however, he himself will not login if I directly access the initial.php he already enters , which may be ?

  • 1

    Possible quadruple of... http://answall.com/questions/8961/comorresolver-o-erro-cannot-modify-header-information-headers-already-sent-by, http://answall.com/questions/28359/warning-ao-tenta-session-start-php, http://answall.com/questions/27864/warning-cannot-Modify-header-information-headers-already-sent-by/27875

  • Please search for error before opening a question.

  • I’ve already researched why such a question.

  • shows this line 1 of your header.php The error message indicates that headers have already been sent

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.