Advertisement
Guest User

Untitled

a guest
Sep 9th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <?php
  2.  
  3. require 'connection.php';//REQUIRE THE CONNECTION.PHP TO CONNECT TO THE DATABASE
  4.  
  5. session_start();
  6.  
  7. $username = mysql_real_escape_string($_POST['username']);
  8.  
  9. $password = mysql_real_escape_string($_POST['password']);
  10.  
  11.  
  12.  
  13. $q = mysql_query("SELECT * FROM admin WHERE Username='$username' AND Password='$password'");//members is the table name in database
  14.  
  15. $username;
  16.  
  17.  
  18. while($row = mysql_fetch_object($q)){
  19.  
  20. $username = $row->username;
  21.  
  22. }
  23.  
  24. if(mysql_num_rows($q)) {
  25.  
  26. $_SESSION['login'] = true;
  27.  
  28. $_SESSION['username'] = $username;
  29.  
  30. header('location:admin/indexA.php');//CHANGE THE FACEBOOK WITH YOUR BOSS WEBSITE
  31. }
  32. else{
  33. header('location:index.php');
  34. }
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement