initial commit
This commit is contained in:
29
conexao.php
Normal file
29
conexao.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
$servidor='localhost';
|
||||
$usuario='root';
|
||||
$senha='';
|
||||
$db='bdprojeto';
|
||||
$con=mysqli_connect($servidor,$usuario,$senha,$db);
|
||||
|
||||
if (!$con){
|
||||
print("Erro na conexão com MySQL");
|
||||
print("Erro: ".mysqli_connect_error());
|
||||
exit;
|
||||
}
|
||||
if(!isset($_SESSION['login']))
|
||||
{
|
||||
$_SESSION['msg'] = "<p align='center'>Acesso Restrito.</p>";
|
||||
header("Location: ..\login\login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
function adm_auth()
|
||||
{
|
||||
if(strcmp($_SESSION['tipo'],'adm') != 0)
|
||||
{
|
||||
$_SESSION['msg'] = "Usuário não autorizado.";
|
||||
header('Location: ../index.php');
|
||||
exit();
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user