<?php
ob_start();/* Evitando warning*/
session_start();
session_destroy();
if(!empty($_GET['erro'])){
die("<script>location='index.php?erro=". $_GET['erro'] ."';</script>");
} else 
die("<script>location='index.php';</script>");

?>