$reg = array_shift($reg); $sw = 1; } else { //echo $sql; header("Location:./?u=" . $url . '&error=1'); } //echo $Nivel; /**/ //$res=mysql_query($sql); //@$reg=mysql_fetch_array($res); $codUsuario = $reg['CodUsuario']; if ($sw) { $Nivel = $reg['Nivel']; } if ($reg['Can'] == 1) { $valuesLog = array("CodLog" => 'NULL', "CodUsuario" => $codUsuario, "Nivel" => $Nivel, "Url" => "'{$url}'", "FechaLog" => "'{$fecha}'", "HoraLog" => "'{$hora}'", "Agente" => "'{$agente}'", "Ip" => "'{$ip}'", "Referencia" => "'{$referencia}'", "Lenguaje" => "'{$lenguaje}'"); $logusuarios->insertarRegistro($valuesLog); //mysql_query("INSERT INTO logusuarios VALUES(NULL,$codUsuario,$Nivel,'$url','$fecha','$hora','$agente','$ip','$referencia','$lenguaje')"); $_SESSION['CodUsuarioLog'] = $codUsuario; $_SESSION['login'] = 1; $_SESSION['Nivel'] = $Nivel; header("Location:../" . $u[1]); } else { header("Location:./?u=" . $url . '&error=1'); //echo "Location:./?u=".$url; } //mysql_close($l); } else { header("Location:./?u=" . $url . '&incompleto=1'); } }