daily pastebin goal
74%
SHARE
TWEET

Untitled

a guest Jan 25th, 2016 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. session_start();
  3. include_once 'config.php';
  4.  
  5. if(isset($_SESSION['user'])!="")
  6. {
  7.  header("Location: home.php");
  8. }
  9. if(isset($_POST['btn-login']))
  10. {
  11.  $email = mysql_real_escape_string($_POST['name']);
  12.  $upass = mysql_real_escape_string($_POST['pass']);
  13.  $res=mysql_query("SELECT * FROM users WHERE username='$email'");
  14.  $row=mysql_fetch_array($res);
  15.  if($row['password']==md5($upass))
  16.  {
  17.   $_SESSION['user'] = $row['user_id'];
  18.   header("Location: home.php");
  19.  } else {
  20.      
  21.      $incorect = '.';
  22.       }
  23. }
  24. ?>
  25. <html>
  26. <head>
  27.     <meta charset="utf-8">
  28.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  29.     <title>MIDECON | Login</title>
  30.     <link href="bootstrap.min.css" rel="stylesheet">
  31.     <link href="animate.css" rel="stylesheet">
  32.     <link href="style.css" rel="stylesheet">
  33. </head>
  34. <body class="gray-bg">
  35.     <div class="middle-box text-center loginscreen  animated fadeInDown">
  36.         <div>
  37.             <p>Prosim prihlas se!</p>
  38.             <?php
  39.             if (isset($incorect)) {
  40.                 echo 'Zle udaje!';
  41.             ?> 
  42.                 <a class="btn btn-sm btn-white btn-block" href="">Vyresetovat heslo</a>
  43.                 <?php
  44.             }
  45.                 ?>
  46.             <form class="m-t" method="post" role="form">
  47.                 <div class="form-group">
  48.                     <input type="text" name="name" class="form-control" placeholder="Meno" required="">
  49.                 </div>
  50.                 <div class="form-group">
  51.                     <input type="password" name="pass" class="form-control" placeholder="Heslo" required="">
  52.                 </div>
  53.                 <td><button type="submit" class="btn btn-primary block full-width m-b" name="btn-login">Prihlasit</button></td>
  54.                 <p class="text-muted text-center"><small>Nemas ucet?</small></p>
  55.                 <a class="btn btn-sm btn-white btn-block" href="reg.php">Registrovat sa</a>
  56.             </form>
  57.         </div>
  58.     </div>
  59. </body>
  60. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top