From e9a885f34120d97be35e95b649051a7f72e444a4 Mon Sep 17 00:00:00 2001 From: Koumaarashankar JAYASHANKAR <koumaarashankar.jayashankar@ensiie.fr> Date: Mon, 9 May 2016 17:25:12 +0200 Subject: [PATCH] modification de authentification et creation --- authentification.php | 53 ------------------------------- creation_compte.php | 61 ------------------------------------ traiter_authentification.php | 7 ++++- traiter_creation_compte.php | 6 +++- 4 files changed, 11 insertions(+), 116 deletions(-) diff --git a/authentification.php b/authentification.php index 2b1faa0..448d468 100644 --- a/authentification.php +++ b/authentification.php @@ -1,4 +1,3 @@ -<<<<<<< HEAD <?php include("Miseenpage_login.php"); @@ -28,56 +27,4 @@ entete("Authentification"); <?php pied(); ?> -======= -<?php -include("Miseenpage.php"); - -entete("Authentification"); -if (isset($_POST['connexion'] && $_POST['connexion']=='Se connecter'{ - if ((isset($_POST['noma']) && !empty($_POST['noma'])) && (isset($_POST['mdpa']) && !empty($_POST['mdpa'])){ - if( $bd= (pg_connect("host=pgsql2 user))){ - $requete='SELECT COUNT(*) FROM compte_client WHERE nom=$_POST['noma'] AND MdP=$_POST['mdpa']'; - $response=pg_query($bd,$requete); - if($response){ - $nbrow=pg_num_rows($response); - if($nbrow==0){ - $erreur="Ce compte n'existe pas, veuillez vérifiez vore nom et votre mot de passe"; - } - else if($nbrow>1){ - $erreur="plusieurs comptes de meme nom et mot de passe"; - } - else{ - session_start(); - $_SESSION['nom']=$_POST['nom']; - header(...); - exit(); - - } - } - } - else{ - $erreur="problème de connexion au base de données" - } - } - else { - $erreur="un des champs est vide" - } -} - - ?> - -<h1>Connectez vous</h1> -<p> -<form action="authentification.php" method="POST"> -Nom <input type="text" name="noma" value="<?php if (isset($_POST['noma'])) echo $_POST['noma']; ?>"><br/> -Mot de passe <input type="password" name="mdpa" value="<?php if (isset($_POST['mdpa'])) echo $_POST['mdpa']; ?>"/> -<input type="submit" name="connexion" value="Se connecter"> -</p> -</form> -<a href="creation_compte">Inscription</a> -<?php -if (isset($erreur)) echo'</br>',$erreur; -pied(); -?> ->>>>>>> 97aae529857f74eae932ce60288adc2cbada47f0 diff --git a/creation_compte.php b/creation_compte.php index 27c2db2..b131f28 100644 --- a/creation_compte.php +++ b/creation_compte.php @@ -1,5 +1,4 @@ <?php -<<<<<<< HEAD include("Miseenpage_create.php"); entete("Création de compte"); @@ -36,63 +35,3 @@ entete("Création de compte"); <?php pied(); ?> -======= -include("Miseenpage.php"); - -entete("Création de compte"); - -if (isset($_POST['inscription'] && $_POST['inscription']=='Inscription'{ - if ((isset($_POST['nom']) && !empty($_POST['nom'])) && (isset($_POST['prenom']) && !empty($_POST['prenom'])) && (isset($_POST['DoB']) && !empty($_POST['DoB'])) && (isset($_POST['mdp']) && !empty($_POST['mdp'])) && (isset($_POST['mdp_c']) && !empty($_POST['mdp_c']))){ - if ($_POST['mdp']!=$_POST['mdp_c']){ - $erreur="Les deux mot de passes sont différents"; - } - else { - if( $bd= (pg_connect("host=pgsql2 user))){ - $requete='SELECT COUNT(*) FROM compte_client WHERE nom=$_POST['nom']'; - $response=pg_query($bd,$requete); - if ($response){ - if(($nbrow=pg_num_rows($response))==0){ - $requete='INSERT INTO compte_client VALUES ("",$_POST['nom'],$_POST['prenom'],$_POST['DoB'],$_POST['mdp']); - $response=pg_query($bd,$requete); - } - else{ - $erreur="Ce Nom est déjà utilisé"; - } - } - else{ - $erreur="Requete non effectué" - } - } - else{ - $erreur="Problème de connexion au base de données"; - } - } - } - else{ - $erreur="au moins un des champs est vide"; - } -} -?> - -<ul> -<li>Home</li> -<li>Reservation</li> -</ul> - -<h1>Complétez ce formulaire</h1> -<p> -<form action="creation_compte.php" method="POST"> -Nom <input type="text" name="nom" value="<?php if (isset($_POST['nom'])) echo $_POST['nom']; ?>"><br/> -Prénom <input type="text" name="prenom" value="<?php if (isset($_POST['prenom'])) echo $_POST['prenom']; ?>" /><br/> -Date de Naissance <input type="text" name="DoB" value="<?php if (isset($_POST['DoB'])) echo $_POST['DoB']; ?>" /><br/> -Mot de passe <input type="password" name="mdp" value="<?php if (isset($_POST['mdp'])) echo $_POST['mdp']; ?>"/><br/> -Confirmez mot de passe <input type="password" name="mdp_c" value="<?php if (isset($_POST['mdp_c'])) echo $_POST['mdp_c']; ?>" /><br/> -</p> -<input type="submit" name="inscription" value="Inscription"> -</form> - -<?php -if (isset($erreur)) echo'</br>',$erreur; -pied(); -?> ->>>>>>> 97aae529857f74eae932ce60288adc2cbada47f0 diff --git a/traiter_authentification.php b/traiter_authentification.php index 365f256..d7c620c 100644 --- a/traiter_authentification.php +++ b/traiter_authentification.php @@ -45,6 +45,11 @@ if (isset($_POST['connexion']) && $_POST['connexion']=='Se connecter'){ ?> <?php -if (isset($erreur)) echo'</br>',$erreur; +if (isset($erreur)) echo'</br><div style="width:50%;text-align:center;margin: 0px auto;"><font color="#FFFFFF">',$erreur,'</font></br></div>'; +?> +</br> +</br> +<a href="authentification.php"><div style="width:50%;text-align:center; border: 5px solid black;margin: 0px auto;"><font color="#FFFFFF"> Retour à la page de l'authentification </font></br></div></a> +<?php pied(); ?> diff --git a/traiter_creation_compte.php b/traiter_creation_compte.php index 9990b50..5fc9fba 100644 --- a/traiter_creation_compte.php +++ b/traiter_creation_compte.php @@ -49,6 +49,10 @@ entete("traiter_Authentification"); } ?> <?php -if (isset($erreur)) echo'</br>',$erreur; +if (isset($erreur)) echo'</br><div style="width:50%;text-align:center;margin: 0px auto;"><font color="#FFFFFF">',$erreur,'</font></br></div>';?> +</br> +</br> +<a href="creation_compte.php"><div style="width:50%;text-align:center; border: 5px solid white;margin: 0px auto;"><font color="#FFFFFF"> Retour à la page de creation </font></br></div></a> +<?php pied(); ?> -- GitLab