Código PHP:
  
    <?php
   include("../includes/config.php");    
    session_start();
 
 
 
    ?>
 
    <?
    if (isset($_SESSION['s_username'])) {
    echo "Bienvenido a mi sitio has ingresado como ".$_SESSION['s_username'].", gracias por la visita!";
    }else{
    echo "Tu no estas autentificado dirígete a login.php o registrate en register.php";
    echo $_SESSION['s_username'];
    }
    ?>    
Código:
  
incluso eso de q no estoy autentificado no se por q lo da, si si inicio sesion en mi pagina de login:Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/phpmexic/public_html/pruebas/users/web.php:1) in /home/phpmexic/public_html/pruebas/users/web.php on line 3 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/phpmexic/public_html/pruebas/users/web.php:1) in /home/phpmexic/public_html/pruebas/users/web.php on line 3 Tu no estas autentificado dirÃ*gete a login.php o registrate en register.php
Código PHP:
  
    <?PHP
   include("../includes/config.php");
    session_start();
 
    if ($_POST['username']) {
    //Comprobacion del envio del nombre de usuario y password
    $username=$_POST['username'];
    $password=$_POST['password'];
    if ($password==NULL) {
    echo "La password no fue enviada";
    }else{
    $query = mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error());
    $data = mysql_fetch_array($query);
    if($data['password'] != $password) {
    echo "Login incorrecto";
    }else{
    $query = mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error());
    $row = mysql_fetch_array($query);
    $_SESSION["s_username"] = $row['username'];
    echo "Has sido logueado correctamente ".$_SESSION['s_username']." y puedes acceder al index.php.";
    }
    }
    }
    ?>    
Código:
  
no se por que :(Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/phpmexic/public_html/pruebas/users/web.php:1) in /home/phpmexic/public_html/pruebas/users/web.php on line 3 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/phpmexic/public_html/pruebas/users/web.php:1) in /home/phpmexic/public_html/pruebas/users/web.php on line 3 Tu no estas autentificado dirÃ*gete a login.php o registrate en register.php
podrian ayudarme? Gracias
 
 




