tengo un problema con mi codigo para auntentificarse que me funciona en mi wampserv pero en mi hosting no D: me da este codigo de error:
Cita:
y mi codigo para autentificar es: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/cherryst/public_html/sesion.php:1) in /home/cher/public_html/sesion.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/cherryst/public_html/sesion.php:1) in /home/cher/public_html/sesion.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /home/cherryst/public_html/sesion.php:1) in /home/cherryst/public_html/sesion.php on line 18
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/cherryst/public_html/sesion.php:1) in /home/cher/public_html/sesion.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /home/cherryst/public_html/sesion.php:1) in /home/cherryst/public_html/sesion.php on line 18
Código PHP:
<?php
session_start();
include('conexion-bd.php');
$usuario = $_POST['us'];
$password = $_POST['pw'];
$pass = md5($password);
$url = $_POST['url'];
$resultado = mysql_query("select usuario from usuarios where usuario = '$usuario' and contrasena = '$pass'");
$filas = mysql_num_rows($resultado);
if($filas==1) {
$_SESSION['conectado']="OK";
$_SESSION['us'] = $_POST['us'];
$_SESSION['pw'] = $pass;
header("Location: $url");
} else {
header("Location: login-error");
}
?>
espero que me puedan ayudar, gracias