Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2.     session_start();
  3.     include "connect.php";
  4.     $databas=mysql_select_db('emiisa');
  5.     if($_POST[tryck]){      
  6.         $sql="SELECT * from user WHERE ID='$_POST[id]' AND PW='$_POST[pw]'";
  7.         $resultat=mysql_query($sql);
  8.         $_SESSION[status]=0;
  9.         while($rad=mysql_fetch_array($resultat)){
  10.             $_SESSION[id]=$rad[ID];
  11.             $_SESSION[status]=$rad[status];
  12.         }
  13.         if($_SESSION[status]!=1 and $_SESSION[status]!=2){      
  14.             print('Fel inloggningsuppgifter!');
  15.         }
  16.     }
  17.     print ('Välkommen '.$_SESSION[id].' <br /><a href="users.ph">Användare</a> <br /><a href="logout.php">Logga ut</a>');
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement