Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $username=$_COOKIE["user"];
  5. $password=$_COOKIE["pass"];
  6.  
  7. $NAME_OF_USER="";
  8.  
  9.  
  10.  
  11. $sql = "SELECT nameofuser FROM users WHERE username='$username' AND password= '$password'";
  12. $result = $conn->query($sql);
  13.  
  14. if ($result->num_rows > 0) {
  15. // output data of each row
  16. while($row = $result->fetch_assoc()) {
  17. $NAME_OF_USER=$row['nameofuser'];
  18.  
  19.  
  20.  
  21. }
  22. }else{
  23. echo "<script>window.location='index.php';</script>";
  24.  
  25. }
  26.  
  27.  
  28.  
  29.  
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement