Modification du systeme de connexion a la bd

This commit is contained in:
remi.biette 2019-05-10 09:43:17 +02:00
parent a2e72de86c
commit 158d2825e0
4 changed files with 11 additions and 35 deletions

View File

@ -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;
}
?>

View File

@ -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');

View File

@ -1,7 +1,6 @@
<?php
require("connectionBD.php");
$db = connexionBD();
require_once("connectionBD.php");
init();
function printError(){

View File

@ -1,7 +1,6 @@
<?php
require ('connectionBD.php');
$db = connexionBD();
require_once ('connectionBD.php');
init();
function printError(){