Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/01/2012, 17:14
dezagus
 
Fecha de Ingreso: abril-2010
Ubicación: Ping: BSAS - Arg
Mensajes: 791
Antigüedad: 14 años
Puntos: 25
¿A que se debe este error?

Desde que cambie de localhost a hostgator me sale esto:

Cita:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/#/public_html/login.php on line 59

Warning: Cannot modify header information - headers already sent by (output started at /home/#/public_html/login.php:59) in /home/#/public_html/login.php on line 136
Es raro, porque mi código funcionaba bien en localhots (xammp).

¿A que se puede deber?
Adjunto el código completo por si es de ayuda.
Lo curioso es que el error se repite en varios de mis php.
Gracias desde ya! =)


Código PHP:

<?php

session_start
();

if (
basename($_SERVER["REQUEST_URI"]) != str_replace(".php"""basename($_SERVER["REQUEST_URI"]))){
header("Location: ".str_replace(".php"""basename($_SERVER["REQUEST_URI"])));
}

error_reporting(E_ALL E_NOTICE E_DEPRECATED);

///////  Conectar DB
include 'functions/conect.php';
///////

///////  Obtener Dir
$str $_SERVER['HTTP_REFERER'];
$arr split("/",$str);
$num count($arr);
/////// 

///////  Contar @
function cntarroba($acontar){
return 
count(explode("@",$acontar)) -1
}

///////

/////// Validar Formulario > Obtener IP Visitante
include 'functions/getip.php';
$frm["ip"] = getRealIP();
///////

if ( ! empty($_POST)){

        
/////// Logeo > ¿Enviado?
        
if( !empty($_POST["Usuario"]) && !empty($_POST["Password"]) ){
        
            
/////// Logeo > ¿Enviado? > Limpiar
            
function tags($tags){  
                
$tags strip_tags($tags);  
                
$tags stripslashes($tags);  
                
$tags htmlentities($tags);  
                return 
trim($tags);  
            } 
            
///////
            
            /////// Logeo > ¿Enviado? > Generar Array
            
$lgn= array(
            
"usuario" => tags($_POST["Usuario"]), 
            
"password" => tags($_POST["Password"])
            );
            
///////
        
            /////// Logeo > ¿Enviado? > Contar Cuentas
            
if ( cntarroba($lgn["usuario"]) > ){
                
$cntaver mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM Usuarios WHERE Correo = '".$lgn["usuario"]."' AND Password = '".$lgn["password"]."'"));
                
$correo true;
            }else{
                
$cntaver mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM Usuarios WHERE Apodo = '".$lgn["usuario"]."' AND Password = '".$lgn["password"]."'"));
            }
            
///////
            
            /////// Logeo > ¿Enviado? > ¿Existe Cuenta?
            
if ($cntaver[0] >= 1){
                
                
                
/////// Logeo > ¿Enviado? > ¿Existe Cuenta? > Obtener Apodo
                
if ($correo){
                    
$apodoarray mysql_fetch_array(mysql_query("SELECT Apodo FROM Usuarios WHERE Correo = '".$lgn["usuario"]."' AND Password = '".$lgn["password"]."'"));
                }else{
                    
$apodoarray mysql_fetch_array(mysql_query("SELECT Apodo FROM Usuarios WHERE Apodo = '".$lgn["usuario"]."' AND Password = '".$lgn["password"]."'"));
                }
                
$_SESSION["account"] = $apodoarray["Apodo"];
                
///////
                
                /////// Logeo > ¿Enviado? > ¿Existe Cuenta? > Verificar Estado y Redireccionar
                
$estado mysql_fetch_array(mysql_query("SELECT EstadodeCuenta FROM Usuarios WHERE Apodo = '".$_SESSION["account"]."'"));
                
$imgperf mysql_fetch_array(mysql_query("SELECT ImgPerfilUID FROM Usuarios WHERE Apodo = '".$_SESSION["account"]."'"));
                
                if( 
$estado["EstadodeCuenta"] == ){
                    
// Cuenta cerrada
                    
header("Location: ".$arr[$num-1]."?err=cuentacerrada");
                }elseif( 
$estado["EstadodeCuenta"] == ){
                
                    
header("Location: validarc");
                    
                }elseif( 
$estado["EstadodeCuenta"] == ){
                
                    
$cntimgperfil mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM ImgPerfilCargados WHERE Apodo = '".$_SESSION["account"]."' AND EstadoPic = '1'"));
                    if(
$imgperf["ImgPerfilUID"] != ""){
                    
                    
$correoaguardar mysql_fetch_array(mysql_query("SELECT Correo FROM Usuarios WHERE Apodo = '".$_SESSION["account"]."'"));
                    
                    
// Guardar dátos del logeo
                    
mysql_query("INSERT INTO Logeos (Apodo, Correo, IP, Dia, Mes, Yea) VALUES (
                    
                    '"
.$_SESSION["account"]."', 
                    '"
.$correoaguardar["Correo"]."', 
                    '"
.$frm["ip"]."', 
                    '"
.date("d")."',
                    '"
.date("m")."',
                    '"
.date("Y")."'
                    
                    )"
);
                    
//
                    
                                    ///////////////////////////////////////////////////
                                                
$_SESSION["login"] = true;
                                                
$_SESSION["pannel"] = false;
                                                
header("Location: home");
                                    
///////////////////////////////////////////////////
                                                
                    
}else{
                        
// Chekear si es la primera ves que carga una imagen perfíl o está vencida
                        
if ($cntimgperfil[0] == 0){
                            
// Primera ves
                            
$_SESSION["pannel"] = true;
                            
header("Location: perfilimg");
                            
//
                        
}else{
                            
// Está vencida
                            
header("Location: perfilimg?err=vencido");
                            
//
                        
}
                        
//
                    
}
                    
                }else{
                    
// Tipo de cuenta desconocido
                    
header("Location: ".$arr[$num-1]."?err=tipocuentadesconocido");
                }
                
///////
                
            
}else{
                
// Cuenta no existe
                
header("Location: ".$arr[$num-1]."?err=cuentainexistente");
            }
            
///////
        
        
            
        
}else{
        
            
/////// Logeo > ¿Enviado? > Volver a Web con Color por GET    
            
if( !empty($_POST["Usuario"]) ){
            
                
$_SESSION["dtloginfalt"]["usuario"] = '#d8ffda';
                
$_SESSION["dtloginfalt"]["password"] = '#ffd8d8';
                
$_SESSION["lgnrevw"]["usuario"] = $_POST["Usuario"];
                
header("Location: ".$arr[$num-1]);
                
            }elseif( !empty(
$_POST["Password"]) ){
            
                
$_SESSION["dtloginfalt"]["usuario"] = '#ffd8d8';
                
$_SESSION["dtloginfalt"]["password"] = '#d8ffda';
                
header("Location: ".$arr[$num-1]);
                
            }else{
            
                
$_SESSION["dtloginfalt"]["usuario"] = '#ffd8d8';
                
$_SESSION["dtloginfalt"]["password"] = '#ffd8d8';
                
header("Location: ".$arr[$num-1]);
            
            }
            
///////
            
        
}
        
///////

}else{
    
header("Location: register");
}

?>