1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| <?php
require('../config.php5');
require('../includes/fonctions.inc.php5');
$session = new k_session();
$bdd = new mysql($sql['host'],
$sql['user'],
$sql['pwd'],
$sql['db'] );
if ( !isset($_SESSION['user']) )
{
/* mises en session de l'objet user */
$_SESSION['user'] = new user($_POST['pseudo'], $_POST['pwd']);
/* connexion de l'utilisateur */
$_SESSION['user']->login($bdd);
}
if( !$_SESSION['user']->loggue )
{
$_SESSION['user']->loggue = FALSE;
session_unset();
/* utilisation de l'URL absolue pour la redirection vers la page d'authentification */
header("Location: http://" . $_SERVER['HTTP_HOST']
. rtrim(dirname($_SERVER['PHP_SELF']), '/\\')
. "/index.php5?msg=1");
}
[...]
?> |
Partager