Guest User

Untitled

a guest
Jan 17th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. ob_start();
  3. if (isset($_POST['submit4']))
  4. {
  5. echo "Username :";
  6. echo $username = $_POST['username'];
  7. echo "<br>";
  8. echo "Password :";
  9. echo $password = $_POST['password'];
  10. include_once("db_con.php");
  11. $sql="select * from admin_table where username='$username' AND password='$password'";
  12. $exe=mysql_query($sql);
  13. $rows = mysql_num_rows($exe);
  14. if($rows>0)
  15. {
  16.  
  17. if(isset($_POST['rememberme'])){
  18.  
  19. setcookie("username", $username, time()*60);
  20. setcookie("password", $password, time()*60);
  21.  
  22.  
  23. }
  24.  
  25.  
  26.  
  27. $fetch = mysql_fetch_array($exe);
  28. $uniqueid = $fetch['admin_id'];
  29.  
  30. session_start();
  31. $_SESSION['admin_id'] = $uniqueid;
  32.  
  33. header("location:dashboard.php?msg=LoginSuccess");
  34. }
  35. else
  36. {
  37. header("location:admin_form.php?msg=LoginFailed");
  38. }
  39. }
  40. ?>
Add Comment
Please, Sign In to add comment