Modification du systeme de connexion a la bd
This commit is contained in:
parent
a2e72de86c
commit
158d2825e0
@ -1,19 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: REMI
|
||||
* Date: 16/04/2019
|
||||
* Time: 14:46
|
||||
*/
|
||||
|
||||
|
||||
function connexionBD(){
|
||||
$host = "localhost";
|
||||
$dbname = "projet";
|
||||
$user = "utilisateur";
|
||||
$pass = "-stri-";
|
||||
$db = pg_connect("host=$host port=5432 dbname=$dbname user=$user password=$pass") or die("Erreur lors de la connexion à la base de données.");
|
||||
return $db;
|
||||
}
|
||||
?>
|
||||
|
||||
|
@ -1,21 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: REMI
|
||||
* Date: 19/04/2019
|
||||
* Time: 10:10
|
||||
*/
|
||||
|
||||
require 'connectionBD.php';
|
||||
$db = connexionBD();
|
||||
init();
|
||||
require_once 'connectionBD.php';
|
||||
|
||||
function init(){
|
||||
session_start();
|
||||
if (isset($_SESSION['mail'])){
|
||||
session_unset();
|
||||
session_destroy();
|
||||
}
|
||||
header('Location: index.php');
|
||||
exit();
|
||||
session_start();
|
||||
|
||||
if (isset($_SESSION['mail'])){
|
||||
session_unset();
|
||||
session_destroy();
|
||||
}
|
||||
header('Location: index.php');
|
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
require("connectionBD.php");
|
||||
$db = connexionBD();
|
||||
require_once("connectionBD.php");
|
||||
init();
|
||||
|
||||
function printError(){
|
||||
|
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
require ('connectionBD.php');
|
||||
$db = connexionBD();
|
||||
require_once ('connectionBD.php');
|
||||
init();
|
||||
|
||||
function printError(){
|
||||
|
Loading…
Reference in New Issue
Block a user