Advertisement
Guest User

Untitled

a guest
Nov 25th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.75 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. session_start();
  4. ob_start();
  5. include "dir/protect/global_config.php";
  6.  
  7. if(isset($_POST['logar'])){
  8.  
  9.       $username = $_POST['username'];
  10.  
  11.       $user_password = $_POST['senha'];
  12.  
  13.       $info_valida = mysql_query("select * from `son` where `username` = '".mysql_real_escape_string($username)."' and `password` = '".mysql_real_escape_string($user_password)."'");
  14.      
  15.       if($username == "" || $user_password == "")
  16.       {
  17.         $error = '<div class="info">Preencha os campos</div>';
  18.       }
  19.       elseif(mysql_num_rows($info_valida) == 1)
  20.       {
  21.         $verificar = mysql_fetch_array($info_valida);
  22.         $_SESSION["LOGADO"] = $verificar["username"];
  23.         header("location: logado.php");
  24.       }
  25.      
  26.       else
  27.       {
  28.         $error = 'Dados inválidos<br>';
  29.       }
  30.     }
  31. ?>
  32.  
  33. <!DOCTYPE HTML">
  34. <html lang="pt-br">
  35.    
  36.     <head>
  37.         <link rel="stylesheet" type="text/css" href="dir/css/main.css">
  38.         <meta charset="utf-8">
  39.         <meta http-equiv="X-UA-Compatible" content="IE=edge">
  40.         <meta name="viewport" content="width=device-width, initial-scale=1">   
  41.         <title>Son Central - SHADOW</title>
  42.     </head>
  43.  
  44. <body>
  45.  
  46. <div class="wrapper">
  47.     <div class="container">
  48.         <h1>Son Checker</h1>
  49.        
  50.         <form class="form" method="post">
  51.         <font id="error"><?=$error; ?></font>
  52.             <input type="text" placeholder="Username" name="username">
  53.             <input type="password" placeholder="Password" name="senha">
  54.             <button type="submit" id="login-button" name="logar">Login</button>
  55.         </form>
  56.     </div>
  57.    
  58.     <ul class="bg-bubbles">
  59.         <li></li>
  60.         <li></li>
  61.         <li></li>
  62.         <li></li>
  63.         <li></li>
  64.         <li></li>
  65.         <li></li>
  66.         <li></li>
  67.         <li></li>
  68.         <li></li>
  69.     </ul>
  70. </div>
  71.   <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
  72.  
  73.  
  74.  
  75. </body>
  76. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement