<?php
session_start();

include_once  'includes/inter.php';

$result = tryToConnect();
switch($result){
	case 'errormdp':
		header('Location:login.php');
		$_SESSION['current_error'] = 'Mot de passe incorrect ...';
		break;
	case 'errorpseudo':
		header('Location:login.php');
		$_SESSION['current_error'] = 'Nom d\'utilisateur incorrect ...';
		break;
	default:
		echo $result;
		echo $_POST['mdp'];
		$_SESSION['session_id'] = $result;
		$_SESSION['session_mdp'] = $_POST['mdp'];
		$_SESSION['current_error'] = 'Vous &ecirc;tes bien connect&eacute; (vous l\'avez &eacute;t&eacute; et le serez &eacutegalement)!';
		header('Location:index.php');
		break;
		
}
