Guest User

Untitled

a guest
Jul 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php
  2. /**
  3. * Name: Guest Handler
  4. * About: Handles certain internet protocal addresses by allowing them access to the site
  5. */
  6.  
  7. // Checking if it's already defined
  8. if(!defined("GUEST_HANDLER_ON")) {
  9. define("GUEST_HANDLER_ON", true); // On by default
  10.  
  11. if(GUEST_HANDLER_ON == true) {
  12.  
  13. $sql = "SELECT pa FROM members"; // Get users' protocol address
  14. $query = mysql_query($sql);
  15.  
  16. while($row = mysql_fetch_array($query)) {
  17. $ip = $row['pa'];
  18. }
  19. if($_SERVER['REMOTE_ADDR'] == ($ip | "127.0.0.1")) {
  20. echo "allowed > ";
  21. } else {
  22. echo "not allowed > ";
  23. }
  24. echo $_SERVER['REMOTE_ADDR'] . " Does not match " . $ip;
  25. //header("Location: " . siteinfo('home_url') . "404.php");
  26. }
  27. }
  28. ?>
Add Comment
Please, Sign In to add comment