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