X-Git-Url: http://git.euphorik.ch/?p=cl7.git;a=blobdiff_plain;f=php%2Fconnexion.php;h=fc3b050df767ca9a1ecf3d0e3e0abd0c11424f2f;hp=0701270baca0058dec3b88e11fb3bd435ced61fc;hb=ca33eb6a816b02a621896aa446cc9317e770993d;hpb=d795f4b57777e1b38037b8ea894ef211182903f2 diff --git a/php/connexion.php b/php/connexion.php index 0701270..fc3b050 100644 --- a/php/connexion.php +++ b/php/connexion.php @@ -1,18 +1,44 @@ -'); + fclose($f); + echo "Le fichier a été créé, veuillez le compléter et recommencer."; + exit(); +} + include_once("config_bd.php"); -include_once("class_participant.php"); +include_once("class_participant.php"); $lien_mysql = mysql_connect($SQL_HOTE, $SQL_LOGIN, $SQL_PASS); -mysql_select_db($NOM_BASE); -mysql_set_charset("UTF8"); +if (!$lien_mysql || !mysql_select_db($NOM_BASE)) +{ + echo "Connexion à la base de données impossible. Voir le fichier 'php/config_bd.php'"; + exit(); +} + +mysql_set_charset("UTF8"); mysql_query('SET AUTOCOMMIT=0'); -if (isset($_POST['effacer_cookie'])) # le membre se délogue +if (isset($_POST['effacer_cookie'])) # le membre se délogue { setcookie("COOKIE_INFO_PATICIPANT", "", time() - 100); # 'efface' le cookie membre unset($HTTP_COOKIE_VARS["COOKIE_INFO_PATICIPANT"]); @@ -27,13 +53,13 @@ if (isset($_POST['log'])) # le membre se logue setcookie ("COOKIE_INFO_PATICIPANT", $le_participant->info->id, time() + 31104000); } } -else if (isset($HTTP_COOKIE_VARS["COOKIE_INFO_PATICIPANT"])) # le cookie existe deja chez le participant +else if (isset($HTTP_COOKIE_VARS["COOKIE_INFO_PATICIPANT"])) # le cookie existe deja chez le participant { - $le_participant = new Participant($HTTP_COOKIE_VARS["COOKIE_INFO_PATICIPANT"]); + $le_participant = new Participant($HTTP_COOKIE_VARS["COOKIE_INFO_PATICIPANT"]); } -else +else { - $le_participant = new Participant(); + $le_participant = new Participant(); } ?> \ No newline at end of file