PHP Classes

File: example/anotherpage.php

Recommend this page to a friend!
  Classes of Jorge Castro   Security One Mysql   example/anotherpage.php   Download  
File: example/anotherpage.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Security One Mysql
Implement a login page for users in a MySQL table
Author: By
Last change:
Date: 1 month ago
Size: 806 bytes
 

Contents

Class file image Download
<?php

use eftec\bladeone\BladeOne;
use
eftec\PdoOne;
use
eftec\SecurityOneMysql;

include
"../vendor/autoload.php";

$conn=new PdoOne('mysql',"127.0.0.1","root","abc.123","securitytest","log.txt"); //CREATE SCHEMA `securitytest` ;

try {
   
$conn->connect();
} catch (
Exception $e) {
    die(
"Error :".$e->getMessage());
}

$sec=new SecurityOneMysql($conn,"../lib/");
$sec->whiteList[]='anotherpage.php';
$sec->validate();
$obj=$sec->getCurrent(true);

$blade=new BladeOne("view","compile");

$blade->setAuth($sec->user,$sec->group[0],$sec->group); // integrate security with blade

if($obj===null) {
    echo
$blade->run("anotherpage",['user'=>null,'groups'=>null,'name'=>null]);
} else {
    echo
$blade->run("anotherpage",['user'=>$obj['user'],'groups'=>$obj['group'],'name'=>$obj['name']]);
}