Tema: Sesiones
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/06/2011, 12:09
ofertasdiariass
 
Fecha de Ingreso: mayo-2011
Mensajes: 38
Antigüedad: 13 años
Puntos: 4
Sesiones

Hola, estoy necesitando su ayuda

tengo estos script :

Login

Código PHP:
<?php

/*
This script was downloaded at:
LightPHPScripts.com
Please support us by visiting
out website and letting people
know of it.
Produced under: LGPL
*/

/* Start session */
if($startSession == TRUE){ session_start();}

/* Config file */
include('config.php');

/* Check for submition */
if($_POST['submitID'] == 1){
    
    
/* Connect to database */
    
if($connectDatabase == TRUE){$action=TRUE;include('connect.php');}
        
    
/* sanitize and check info */
    
$userName mysql_real_escape_string($_POST['userName'],$dbc);
    
$password mysql_real_escape_string($_POST['password'],$dbc);
    
    if(
$userName == NULL) { $message 'Por favor ingrese nombre de usuario.';}
    if(
$message == NULL && $password == NULL){ $message 'Por favor, introduzca la Clave.';}
    
    if(
$message == NULL)
    {                
        
$userQuery mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM " $tableName .
        
" WHERE `" $userNameField "`='$userName' AND `" $userPasswordField "`='$password'"));        
        
        
/* If usercount is more than 0 -> ok */
        
if($userQuery[0] > 0){
            
/* Disconnect from database */
            
if($connectDatabase == TRUE){$action=FALSE;include('connect.php');}
    
            
$_SESSION['isLoged'] = 'yes';
            
$_SESSION['userName'] = $userName;
            
            
/* add cookies ?*/
            /* expire in 1 hour */
            
if($useCookies == TRUE)
            {
                
setcookie("isLoged"'yes'time()+logedInFor"/"".$domainName"1);
                
setcookie("userName"$userNametime()+logedInFor"/"".$domainName"1);
            }

            
/* Redirect to login page */
            
header("Location: $loginPage");
            exit();
        } else {
            
$message 'No válido nombre de usuario y / o Clave!';
        }
    }
    
/* Disconnect from database */
    
if($connectDatabase == TRUE){$action=FALSE;include('connect.php');}
}
?><style type="text/css">
<!--
#Layer8 {
    position:absolute;
    left:510px;
    top:220px;
    width:100px;
    height:300px;
    z-index:1;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #0099CC;
}
#Layer9 {
    position:absolute;
    left:200px;
    top:500px;
    width:900px;
    height:50px;
    z-index:1;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #0099FF;
    border-top-width: thin;
    border-top-style: dashed;
    border-top-color: #3399FF;
}
-->
</style>
<div id="Layer8">
<!--
/*
This script was downloaded at:
LightPHPScripts.com
Please support us by visiting
out website and letting people
know of it.
Produced under: LGPL
*/
-->
<?php

/* Display error messages */
if($message != NULL){?>
<div align="center">
  <table width="250"  border="0" cellpadding="3" cellspacing="0" bgcolor="#FFCCCC">
    <tr>
      <td><div align="center"><strong><font color="#FF0000"><?=$message;?></font></strong></div></td>
    </tr>
  </table>
  <?php ?><form action="<? echo $_SERVER['PHP_SELF'];?>" method="post" name="login" id="login" style="display:inline;">
  <table width="250" align="center" cellpadding="5" cellspacing="0">
    <tr bgcolor="#99CC99"> 
      <td colspan="2" bgcolor="B3D9EC"><div align="center"><font color="#FFFFFF"><strong>Validaci&oacute;n de Usuario y Clave:</strong></font></div></td>
    </tr>
    <tr> 
      <td width="47%"><strong>Usuario:</strong></td>
      <td width="53%"><input name="userName" type="text" id="userName"></td>
    </tr>
    <tr> 
      <td><strong>Clave:</strong></td>
      <td><input name="password" type="password" id="password"></td>
    </tr>
    <tr> 
      <td colspan="2"><div align="center"><font face="Georgia, Times New Roman, Times, serif"><strong>
          <input name="Submit" type="submit" id="Submit" value="Ingresar"> <a href="register.php">Registrarme</a> 
          <input name="submitID" type="hidden" id="submitID" value="1">
</strong></font> </div></td>
    </tr>
    <tr>
      <td colspan="2"><div align="center">Compartilo <a href="http://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fofertasdiarias.net%2F&amp;t="><img src="imagenes/facebook.gif" alt="2" width="16" height="16" border="0" /></a> <a href="https://www.google.com/accounts/ServiceLogin?passive=1209600&amp;continue=https%3A%2F%2Fwww.google.com%2Fbookmarks%2Fmark%3Fop%3Dedit%26bkmk%3Dhttp%253A%252F%252Fofertasdiarias.net%252F&amp;hl=es"><img src="imagenes/google.gif" alt="3" width="16" height="16" border="0" /></a> <a href="http://twitter.com/?status=Hoy - Ofertasdiarias Comprar y vender http%3A//ofertasdiarias.net/"><img src="twitter.gif" alt="4" width="16" height="16" border="0" /></a> <a href="https://secure.delicious.com/login?jump=http%3A%2F%2Fwww.delicious.com%2Fsave%3Furl%3Dhttp%253A%252F%252Fofertasdiarias.net%252F%26title%3DHoy%2520-%2520Ofertasdiarias%2520Comprar%2520y%2520vender%26notes%3D%26tags%3D%26noui%3Dno%26jump%3Dyes%26time%3D1306946854%26share%3Dyes%26recipients%3D&amp;v=5"><img src="imagenes/delicious.gif" alt="1" width="16" height="16" border="0" /></a></div></td>
    </tr>
  </table>
</form>
sigue:...