Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Reis</title>
- <meta charset="utf-8">
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
- <style type="text/css">
- body{
- background-color: white;
- font-family:
- }
- #nav{
- opacity: .8;
- padding-top: 50px;
- }
- #nav:hover {
- opacity: 1.0;
- }
- </style>
- </head>
- <body>
- <?php
- $bd_host="localhost";
- $bd_user="root";
- $bd_password="";
- $bd_database="website";
- $ms = new mysqli($bd_host,$bd_user,$bd_password,$bd_database);
- $nome=$email=$tipo=$msg1=$num="";
- if ($ms->connect_error) {
- die('Erro: ('. $ms->connect_errno .') '. $ms->connect_error);
- }
- if(isset($_POST["login"])){
- if($_POST["email"]!="" && $_POST["pass"]!=""){
- $qr = "Select idlogin,nome,mail,tipo from login where mail=? and password=?";
- $ordem = $ms->prepare($qr);
- $ordem->bind_param('ss', $_POST["email"],$_POST["pass"]);
- $ordem->execute();
- $ordem->bind_result($num , $nome, $email , $tipo);
- if($ordem->fetch()){
- $_SESSION["nid"]=session_id();
- $_SESSION["num"]=$num;
- $_SESSION["nome"]=$nome;
- $_SESSION["email"]=$email;
- $_SESSION["tipo"]=$tipo;
- $msg1='<h3 class="ok">Bem Vindo!</h3>';
- }
- else{
- $msg1='<h3 class="alert">Erro, Dados de acesso errados!</h3>';
- }
- $ordem->close();
- }
- else{
- $msg1='<h3 class="alert">Digite os seus dados de acesso</h3>';
- }
- }
- if(isset($_POST["logout"])){
- session_unset();
- session_destroy();
- }
- include "cabecalho.php";
- echo "$msg1";
- ?>
- <?php
- if(isset($_GET['op']))
- {
- include($_GET['op'] . '.php');
- }
- else
- include('default.php');
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment