Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php
  2. include 'conn.php';
  3. session_start();
  4.  
  5. if(isset($_GET['ass'])){
  6. $_SESSION['admin'] = '1';
  7. header("Location: index.php");
  8. }
  9.  
  10. if(isset($_POST['mail'])){
  11.  
  12. $mail = $_POST['mail'];
  13. $pass = md5($_POST['pass']);
  14.  
  15. $sql = "SELECT * FROM user WHERE email='$mail' and senha='$pass'";
  16. $qsl = mysqli_query($conn, $sql);
  17. $user = mysqli_fetch_assoc($qsl);
  18. $conta = mysqli_num_rows($qsl);
  19.  
  20. if($conta>0){
  21. $id = $user['id'];
  22. echo $id;
  23. $_SESSION['admin'] = $id;
  24. $_SESSION['post'] = 'Bem vindo de volta!';
  25. header("Location: index.php");
  26. }else{
  27. $_SESSION['loginerro'] = 'Não foi possivel fazer login!';
  28. header("Location: index.php");
  29. }
  30. header("Location: index.php");
  31. exit();
  32. }
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement