Просмотр файла inc/head.php

Размер файла: 1.46Kb
  1. <?php
  2. defined('WBCAT') or die('Restricted access');
  3. ob_start();
  4. session_start();
  5. error_reporting(E_ALL & ~E_NOTICE);
  6. require_once ('config.php');
  7. require_once ('func.php');
  8.  
  9. # Проверяем ip-адрес на наличие бана #
  10. if(isset($_SERVER['HTTP_X_REAL_IP'])) {
  11. $ip2 = $_SERVER['HTTP_X_REAL_IP'];
  12. } else {
  13. $ip2 = $_SERVER['REMOTE_ADDR'];
  14. }
  15. $ip2 = ip2int($ip2);
  16. $isset = mysql_query("SELECT `ip`,`reason`,`type`,`url` FROM `ban_ip` WHERE `ip`='".$ip2."' LIMIT 1");
  17. if (mysql_num_rows($isset) > 0) {
  18. $res = mysql_fetch_array($isset);
  19. // Полная блокировка
  20. if ($res['type'] == 1) {
  21. echo 'Ваш ip-адрес забанен ! Причина <br/> '.( !empty($res['reason']) ? $res['reason'] : 'причина не указана' ).' ';
  22. exit;
  23. }
  24. // Редирект по ссылке
  25. if ($res['type'] == 2) {
  26. header("Location: " . $res['url']);
  27. exit;
  28. }
  29. }
  30.  
  31.  
  32. echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  33. <html xmlns="http://www.w3.org/1999/xhtml"><head>
  34. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  35. <link rel="stylesheet" type="text/css" href="'.$settings['url'].'/style.css">
  36. <title>Белый wap каталог</title></head>
  37. <div class="head"><img src="'.$settings['url'].'/images/logo.png" alt="logo"/></div>';
  38. ?>