Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'init.php';
- ?>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Login</title>
- <link rel="stylesheet" href="/foundation-6/foundation.css">
- <link rel="stylesheet" href="/foundation-6/app.css">
- <link rel="stylesheet" href="/css/csslogin.css">
- </head>
- <body>
- <div class="divmeioimg">
- <img src="/img/logo_34.jpg">
- </div>
- <div class="large-12 columns">
- <form method="POST" action="login.php">
- <h5 style='font-style:italic;' align="center">Login</h5>
- <div>
- Usuário:<input type="text" name="usuario" >
- </div>
- <div>
- Senha:<input type="password" name="password" >
- </div>
- <input type="submit" class="button" value="Login"/>
- </form>
- </div>
- </body>
- <?php
- require_once 'init.php';
- if(isset($_POST['usuario']) and isset($_POST['password'])){
- require_once('session/db.class.php');
- $user = ($_POST['usuario']);
- $pass = ($_POST['password']);
- $sql = db::query("SELECT * FROM SISWEBUSU WHERE Dslogin = '".$user."' AND DsSenha = '".$pass."'");
- if(count($sql) > 0){
- require_once('session/session.class.php');
- $id = sessao::iniciar();
- sessao::set_var('hash_id',md5(gethostbyaddr($_SERVER['REMOTE_ADDR'])));
- sessao::set_var('sessao',$id);
- sessao::set_var('id_usuario',$sql[0]['DsSenha']);
- header("Location: view/home.php");
- exit();
- }else{
- header("Location: index.php");
- exit();
- }
- }else{
- header("Location: index.php");
- exit();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement