' ); fclose($f); echo "Le fichier a été créé, veuillez le compléter et recommencer."; exit(); } include_once("config_bd.php"); $conn_bd = pg_connect(sprintf("host=%s dbname=%s user=%s password=%s", $SQL_HOTE, $NOM_BASE, $SQL_LOGIN, $SQL_PASS)); if (!$conn_bd) { echo "Connexion à la base de données impossible. Voir le fichier 'php/config_bd.php'"; exit(); } if (isset($_POST['effacer_cookie'])) # le membre se délogue { setcookie("COOKIE_INFO_PARTICIPANT", "", time() - 100); # 'efface' le cookie membre unset($_COOKIE["COOKIE_INFO_PARTICIPANT"]); } if (isset($_POST['log'])) # le membre se logue { $this->participant = new Participant($_POST['pseudo'], $_POST['password']); if ($this->participant->existe()) { setcookie("COOKIE_INFO_PARTICIPANT", $this->participant->info->id, time() + 31104000); $this->message_utilisateur = "Loggation ok"; } else $this->message_utilisateur = "Erreur de loggation"; } else if (isset($_COOKIE["COOKIE_INFO_PARTICIPANT"])) # le cookie existe deja chez le participant { $this->participant = new Participant($_COOKIE["COOKIE_INFO_PARTICIPANT"]); } else { $this->participant = new Participant(); } } } ?>