public function maj() { $bd = new Bd("site_stage"); $co = $bd->connexion(); switch ($this->fonction) { case "etudiant": $resultat = mysqli_query($co, "SELECT nom,prenom FROM etudiant WHERE login='******' AND mdp='{$this->mdp}'"); break; case "enseignant": $resultat = mysqli_query($co, "SELECT nom,prenom FROM enseignant WHERE login='******' AND mdp='{$this->mdp}'"); break; case "tuteur": $resultat = mysqli_query($co, "SELECT nom,prenom FROM tuteur_entreprise WHERE login='******' AND mdp='{$this->mdp}'"); break; } $row = mysqli_fetch_row($resultat); $this->nom = $row[0]; $this->prenom = $row[1]; }
<!--Si l'utilisateur accède a la page alors qu'il n'est pas connecté, on le redirige --> <?php include "../../modeles/membre.php"; session_start(); if (!isset($_SESSION['membre'])) { echo "pas de membre"; header('Location: ../../index.html'); } else { $membre = $_SESSION['membre']; $bd = new Bd("site_stage"); $co = $bd->connexion(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Gestion des stages - Accueil</title> <link href="../../style.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" type="text/css" href="../../js/buttons.css"/> <link rel="stylesheet" type="text/css" href="../../js/animate.css"/> <link rel="stylesheet" href="../../js/font-awesome/css/font-awesome.min.css"/> <script src="../../js/jquery-1.11.1.min.js" type="text/javascript"></script> <style type="text/css"> .tab {border-collapse:collapse;border-spacing:0;} .tab td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;} .tab th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal; background-color:#26ade4;} </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head>