Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_GET['wybor'] == 'logout')
- {
- header("Location:logout.php");
- exit();
- }
- else
- {
- if (empty($_POST['login'])) {
- header("Location: index.php?id=blad_logowania");
- }
- elseif (empty($_POST['haslo'])) {
- header("Location: index.php?id=blad_logowania");
- }
- else {
- $user = $_POST['login'];
- $pass = $_POST['haslo'];
- $polaczenie=mysql_connect("localhost","root","krasnal");
- mysql_select_db("users",$polaczenie);
- $check=mysql_query("SELECT * FROM table_users WHERE login='$user' AND pass='$pass'");
- $liczba=mysql_num_rows($check);
- if ($liczba==1) {
- session_start();
- $_SESSION['userID'] = $user;
- header("Location: index.php");
- }
- else
- {
- header("Location: index.php?id=blad_logowania");
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement