Error when trying to enter I explain in localhost it works fine but when uploading it to some server it marks this error
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /storage/ssd3/893/822893/public_html/index.php:33) in /storage/ssd3/893/822893/public_html/php/login.php on line 11
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /storage/ssd3/893/822893/public_html/index.php:33) in /storage/ssd3/893/822893/public_html/php/login.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd3/893/822893/public_html/index.php:33) in /storage/ssd3/893/822893/public_html/php/login.php on line 15
Look for there that session_start should be at the start after the <?php
<?php
session_start();
but it remains the same also look that it was for the spaces in white good join the lines without leaving lines and remains the same
here is my original code
<?php
$correo=$_POST['correo'];
$clave=md5($_POST['clave']);
require_once('Conexion.php');
$conn = Conectar();
$stmt = $conn->prepare("SELECT id_usuario, nombre, apellido, correo, p.id_perfil, perfil FROM usuario u INNER JOIN perfil p ON p.id_perfil=u.id_perfil WHERE u.correo=:correo AND u.clave=:clave");
$stmt->bindParam(':correo',$correo);
$stmt->bindParam(':clave',$clave);
$stmt->execute();
if($stmt->rowCount()==1){
session_start();
$fila=$stmt->fetch();
$_SESSION['idperfil']=$fila['id_perfil'];
if($fila['id_perfil']==1)
{header("Location: administrador/index.php");}
if($fila['id_perfil']==2)
{header("Location: aprendiz/index.php");}
if($fila['id_perfil']==3)
{header("Location: root/index.php");}
}
else{
echo "<font color='red'>Datos No Validos</font>";
}
?>
I hope you can help me and thank you