Ver Mensaje Individual
  #5 (permalink)  
Antiguo 16/11/2009, 10:35
50l3r
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: Mis Sesiones se pierden al pasar de Pagina

inicio.php

Código PHP:
<?php
 session_start
();
 if (isset(
$_SESSION["blackusuario"])){
 
header ("Location: ../global.php");}
 
 include 
"Includes/load.php";
 
?>

<html>
  <head>
  <title>Pixelizados: Iniciar Sesion</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <!--[if gte IE 5.5000]>
<script type="text/javascript" src="JS/png.js"></script>
<![endif]-->
  <link href="CSS/styles.css" rel="stylesheet" type="text/css" />
  <LINK REL="SHORTCUT ICON" HREF="Images/blackico.ico">
  </head>
<body style="background:#4885B4;">
<img src=../Images/noreg.png style="position:absolute; left:80%; top:37%; z-index:0">
<img style="position:absolute;width:10% ; top:5%" src="Images/invader.gif" width="30%"><center><img src="Images/titulo.gif" width="65%"></center>




<center>
<div id="titulo" style="width:30%;position:relative;z-index:1"><br><br><b>Iniciar Sesion</b></div>
<div id="campos" style="width:30%;overflow:hidden;position:relative;z-index:1">
<form action="inicio.php" method="post">
<br>
    <b>Usuario:<br><br><input type="text" name="usuario" size="20" maxlength="20" />
<br>
<br>
      Contrase�a:<br><br><input type="password" name="password" size="20" maxlength="20" /></b>
<br><br><a href="Funciones/recpass/recordar.php">�Se te olvido la contrase�a?</a><br><br><br>      
        <input type="submit" value="Entrar" size="10" />
<hr>
      </form>
      
�Aun no tienes cuenta?<a href="Funciones/registro/contrato.php"><b>��Registrate��</b></a><br><br><br><br><br><br>




<?php 

include "Funciones/conexionesdb/conus.php";


function 
quitar($mensaje){
$nopermitidos = array("'",'\\','<','>',"\"");
$mensaje str_replace($nopermitidos""$mensaje);
return 
$mensaje;}


if(
trim($HTTP_POST_VARS["usuario"]) != "" && trim($HTTP_POST_VARS["password"]) != "")

{

 
$usuario strtolower(htmlentities($HTTP_POST_VARS["usuario"], ENT_QUOTES));   

 
$password md5($HTTP_POST_VARS["password"]);
    
$result mysql_query('SELECT x, x FROM x WHERE x=\''.$usuario.'\'');

    if(
$row mysql_fetch_array($result)){

        if(
$row["password"] == $password){

 

            
$_SESSION[blackusuario] = $row['username'];

           

            echo 
"<center><b>Has sido logueado correctamente " .$_SESSION['blackusuario']. "</b>";
            
$inicio"home.php?nick=" .$_SESSION['blackusuario'];
            echo 
"<meta http-equiv='refresh' content='1; url=global.php' />";


        }else{

            echo 
"<center><div style='color:#ff0000;'><b>Contrase�a incorrecta</b></div></center>";

        }

    }else{

        echo 
"<center><div style='color:#ff0000;'><b>El Usuario no Existe</b></div></center>";

    }

    
mysql_free_result($result);

}else{

    echo 
"<center><b>Debe Especificar Usuario y Contrase�a</b></center>";

}


mysql_close();


?>
<br><br><br>
</div>
</body>
</html>
pagina.php

Código PHP:
<?php
session_start
();
include 
"Funciones/sessionout.php";
include 
"Includes/load.php";

 ...........
el sesionout lo que hace es que si no existe la sesion te devuelve al inicio