
07/09/2014, 16:43
|
| | Fecha de Ingreso: enero-2014
Mensajes: 100
Antigüedad: 11 años, 1 mes Puntos: 0 | |
Respuesta: error de redireccion coloco el codigo que utilizo y, segun yo, todo esta bien:
Código:
<?php
session_start();
//inicia codigo para dar tiempo de vida a las sesiones
//el tiempo en inactivo esta en segundos
$inactivo=300;
if(isset($_SESSION["tiempo"])){
$vida_sesion=time()-$_SESSION["tiempo"];
if($vida_sesion>$inactivo){
session_destroy();
header("Location: ../admin/index.php?mensaje=informativo&info=Informativo: la sesion a caducado");
}//termina if
}//termina if
$_SESSION["tiempo"]=time();
//termina codigo para dar tiempo de vida a las sesiones
$usuario=$_SESSION["online"];
if(isset($usuario)){
?>
<!DOCTYPE html>
<html lang="es">
<head>
<title><?php echo "Bienvenido(a): ",$_SESSION["online"]; ?></title>
<meta charset="utf-8" />
<!--estilos del programa principal-->
<link rel="stylesheet" href="../estilos/principal.css">
<!--estilos de los modulos-->
<link rel="stylesheet" href="../modulos/estilos/prestadores.css">
<!--librerias necesarias para diseño de la web-->
<link rel="stylesheet" href="../jquery-ui-1.11.1.custom/jquery-ui.min.css">
<script src="../jquery-ui-1.11.1.custom/external/jquery/jquery.js"></script>
<script src="../jquery-ui-1.11.1.custom/jquery-ui.min.js"></script>
<script>
<!--menu general-->
/*
$(function() {
$( "#menu_principal" ).tabs();
$("#menu_principal ul li a").click(function () {location.hash = $(this).attr("href");});
});
*/
$.fn.hashTab = function(){
var tabs=this
$("ul.ui-tabs-nav>li>a",tabs).click(function () {location.hash = $(this).attr("href");return false})
$(window).on("hashchange",function(){
var tab= location.hash && tabs.has(location.hash).length ? $(location.hash).index()-1 : 0
tabs.tabs("option","active",tab)
tabs.find("li").eq(tab).focus().blur()
})
}
$(function() {
$( "#menu_principal" ).tabs().hashTab()
});
<!--icono de salir-->
$(function() {
$( "#icons li" ).hover(
function() {
$( this ).addClass( "ui-state-hover" );
},
function() {
$( this ).removeClass( "ui-state-hover" );
}
);
});
//codigo para que el boton pueda cambiar de fondo al
//pasar el cursor del raton
$( document ).ready(function() {
$( "#boton_nuevo" ).button();
$( "#boton_editar" ).button();
$( "#boton_eliminar" ).button();
});
//desvanece el div en 2 segundos (parametro en milisegundos) y
//despues redirecciona a esta misma pagina
$( document ).ready(function() {
$("#mensaje_informativo_prestador").fadeOut(2000, function(){
//window.location = "index.php";
});
$("#mensaje_error_prestador").fadeOut(2000, function(){
//window.location = "index.php";
});
});
</script>
</head>
<body class="ui-state-default">
<div id="menu_principal">
<ul>
<li><a href="#modulo1">Prestadores</a></li>
<li><a href="#modulo2">Servicios y Practicas</a></li>
<li><a href="#modulo3">Asistencias</a></li>
<li><a href="#modulo4">Reportes</a></li>
</ul>
<div id="modulo1">
<?php
include("../modulos/prestadores/prestadores.php");
?>
</div>
<div id="modulo2">
<p>AQUI MODULO DE SERVICIOS Y PRACTICAS</p>
</div>
<div id="modulo3">
<p>AQUI MODULO DE ASISTENCIAS</p>
</div>
<div id="modulo4">
<p>AQUI MODULO DE REPORTES</p>
</div>
</div>
<!--
enlace-boton para salir del sistema
-->
<ul id="icons" class="ui-widget ui-helper-clearfix">
<li class="ui-state-default ui-corner-all"><a href="index.php?salida=salir"><span class="ui-icon ui-icon-power"></span></a></li>
</ul>
<?php
if(isset($_GET["salida"])){
session_destroy();
header("Location: ../admin/index.php?mensaje=informativo&info=Informativo: haz cerrado la sesion");
}//termina if
?>
<!--mensajes de notificacion-->
<?php
require ("reglas/mensajes.php");
?>
</body>
</html>
<?php
}//termina if
else{
header("Location: ../admin/index.php?mensaje=error&error=debes logearte para poder accededer al sistema!!!");
}//termina else
?>
__________________ "Benditos sean todos los libros, pues cuando abres uno, te sumerges en un mundo nuevo y completamente diferente" |