Merhaba
<? } else { header("Location:index.php?sayfa=GirisYap"); } ?>
yerine
<? } else {
echo'<script language="JavaScript">window.location.href =index.php?sayfa=GirisYap; </script>';
} ?>

yazmanız sorunu giderecektir.