Maxdace66

[PHP] User Connexion

Apr 9th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. // Check connection
  2. if ($conn->connect_error) {
  3. die("Connection failed: " . $conn->connect_error);
  4. }
  5.  
  6. $sql = "SELECT * FROM users where id='$key'";
  7. $result = mysqli_query($conn,$sql);
  8. $row = mysqli_fetch_array($conn,$data);
  9.  
  10. $rank = $row['user_type'];
  11.  
  12. if ($rank == 'user') {
  13. header('location: ../index.php');
  14. } elseif ($rank == 'vip' || $rank == 'admin') {
  15. echo "Hi bro u're ".$rank."";
  16. }
Advertisement
Add Comment
Please, Sign In to add comment