redirection après authentification pas possible
Bonjour,
ma page demande à l'utilisateur de s'authentifier et si c'est correct, je voudrais rediriger vers le contenu...sauf que la redirection n'est pas autorisée :
Citation:
Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\eis2\eisnew\header.inc.php:96) in C:\wamp\www\eis2\eisnew\page\authenticate.php on line 49
authenticate.php :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
<?php require_once(dirname(__DIR__).'\_includes\html0-topPHP.php'); // INIT + FONCTIONS et autres config en PHP
?>
<?php require_once(dirname(__DIR__).'/_includes/html1-debut.php'); // contient le DEBUT du code HTML, le contenu de <head> SANS la balise </head> ?>
<?php require_once(dirname(__DIR__).'/_includes/html2-milieu.php'); // contient la balise </head>et le DEBUT du <body>, A PARTIR DE la balise </head> ?>
<?php function authentification()
{
global $bdd;
$auth=false;
...
$_SESSION['auth']=$auth;
return $auth;
}
$auth=authentification();
header ("Location: $_SERVER[HTTP_REFERER]" );
exit(); ?>
<?php require_once(dirname(__DIR__).'/_includes/html3-fin.php'); // contient la FIN du code HTML, jusqu'au </body></html> ?> |
comment puis-je faire ? La ligne 49 correspond ici à la 19. Et ma page a la structure suivante :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
<?php
if ( ! $_SESSION["auth"])
{
// formulaire d'authentification
}
else {
include dirname(__DIR__)."\\language.".$lang.".inc.php"; (__DIR__)."\\language.".$lang.".inc.php<br/>";
include dirname(__DIR__)."\\header.inc.php";
include dirname(__DIR__)."\\menupage.php";
}
// changement de fichier
if ($_SESSION["auth"])
{
//contenu
}
?>
<?php require_once(dirname(__DIR__).'/_includes/html3-fin.php'); // contient la FIN du code HTML, jusqu'au </body></html> ?> |