Advertisement
Guest User

Untitled

a guest
May 13th, 2017
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.16 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  if ($_GET['wybor'] == 'logout')
  5.      {
  6.        header("Location:logout.php");
  7.        exit();
  8.      }
  9.   else
  10.      {
  11.      
  12.     if (empty($_POST['login']))   {
  13.                                   header("Location: index.php?id=blad_logowania");
  14.                                   }
  15.  
  16.       elseif (empty($_POST['haslo']))     {
  17.                                          header("Location: index.php?id=blad_logowania");
  18.                                          }
  19.  
  20.   else {
  21.      
  22.      
  23.     $user = $_POST['login'];
  24.     $pass = $_POST['haslo'];
  25.  
  26.     $polaczenie=mysql_connect("localhost","root","krasnal");
  27.     mysql_select_db("users",$polaczenie);
  28.  
  29.  
  30.     $check=mysql_query("SELECT * FROM table_users WHERE login='$user' AND pass='$pass'");
  31.  
  32.     $liczba=mysql_num_rows($check);
  33.  
  34.      if ($liczba==1)   {
  35.               session_start();
  36.               $_SESSION['userID'] = $user;
  37.               header("Location: index.php");
  38.               }
  39.            else
  40.            {
  41.              header("Location: index.php?id=blad_logowania");
  42.              }                                          
  43.       }
  44.           }
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement