Advertisement
Guest User

Untitled

a guest
Jun 16th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. <?php
  2. // Connects to your Database
  3. mysql_connect("localhost", "root", "1Slm52HZ") or die(mysql_error());
  4. mysql_select_db("miq") or die(mysql_error());
  5. //checks cookies to make sure they are logged in
  6. if(isset($_COOKIE['ID_my_site']))
  7. {
  8. $username = $_COOKIE['ID_my_site'];
  9. $pass = $_COOKIE['Key_my_site'];
  10. $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
  11. while($info = mysql_fetch_array( $check ))
  12. $user_id = $info['user_id'];
  13.  
  14. {
  15.  
  16. //if the cookie has the wrong password, they are taken to the login page
  17. }
  18.  
  19. //otherwise they are shown the user area
  20. else
  21. {
  22. }
  23.  
  24. }
  25. }
  26. else
  27.  
  28. //if the cookie does not exist, they are taken to the login screen
  29. {
  30. header("Location: login.php");
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement