Пример #1
0
 public static function load()
 {
     require 'Autoloader.php';
     App\Autoloader::register();
     require '../core/Autoloader.php';
     Core\Autoloader::register();
 }
Пример #2
0
 public static function load()
 {
     session_start();
     require ROOT . '/app/Autoloader.php';
     App\Autoloader::register();
     require ROOT . '/Core/Autoloader.php';
     Core\Autoloader::register();
 }
Пример #3
0
 public static function load()
 {
     session_start();
     require ROOT . '/app/Autoloader.php';
     App\Autoloader::register();
     require ROOT . '/core/Autoloader.php';
     Core\Autoloader::register();
     //regle de routing
     Router::prefix(PREFIX, 'admin');
     Router::connect('', 'pages/show/1');
     /*Router::connect(':id/categories.html','posts/category/id:([0-9]+)');
       Router::connect('blog/*','posts/*');
       Router::connect('cgv.html','pages/show/1');*/
     Router::connect('login.html', 'users/login');
 }
Пример #4
0
<?php

session_start();
require '../app/Autoloader.class.php';
App\Autoloader::register();
$config = App\Config::getInstance();
$bdd = App\database\Database::getInstance_bdd($config->get("db_name"), $config->get("db_user"), $config->get("db_pass"), $config->get("db_host"));
require '../functions/functions.php';
if (isset($_POST['login']) && isset($_POST['email']) && isset($_POST['password1']) && isset($_POST['password2']) && $_POST['password1'] == $_POST['password2']) {
    if (create_user($bdd, $_POST['login'], $_POST['email'], $_POST['password1'])) {
        $_SESSION['alert'] = "Success";
        header("Location: ../index.php");
        die;
    } else {
        $_SESSION['alert'] = "ERROR";
        header("Location: ../index.php");
        die;
    }
} else {
    $_SESSION['alert'] = "ERROR";
    header("Location: ../index.php");
    die;
}