//BOTÃO LOGOUT
echo "<A style=\"text-align: center;\" class=\"logout\" href=\"java script:;\" onClick=\"confirma_saida();\" target=\"_parent\">Logout</A>";
function confirma_saida() { caixa = confirm("Deseja sair do sistema?"); if (caixa == true) { alert(caixa); //aqui nao funciona no ie window.location.href="logout.php?logoff=ok"; } }
logout.php
<? //INICIALIZA A SESSÃO session_start(); $logoff = isset ($_GET["logoff"])?$_GET["logoff"]:""; if ($logoff == "ok") { //DESTRÓI AS VARIÁVEIS unset($_SESSION['matricula']); unset($_SESSION['senha']); session_destroy(); //REDIRECIONA PARA A TELA DE LOGIN header("Location: index.php"); } ?>
Edição feita por: Josy, 15/01/2008, 09:32.