Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.00 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include ('configuration/config.php');
  4. if ($_REQUEST['page_1'] == 'download' and isset($_REQUEST['page_2']) )
  5. {
  6.  
  7.     @$connect = mysql_connect(HOST, DB_LOG, DB_PASS) or die( include('inc/body/error_connect.html') );
  8.     mysql_select_db(DB_NAME) or die( $this->error_print('<span style="font-weight:bold">Błąd połączenia z bazą danych</span>') );
  9.     mysql_query('SET CHARACTER SET LATIN2') or die ( $this->sql_error('SET CHARACTER SET UTF8') );
  10.     $result = mysql_query('select * from pages_img where src LIKE "'.$_REQUEST['page_2'].'%"');
  11.     $row = mysql_fetch_assoc($result);
  12.  
  13.     if (file_exists('images/original/'.$row['src'])) {
  14.  
  15.         $file = 'images/original/'.$row['src'];
  16.         $filename = $row['description'];
  17.         header("Content-Type: application/octet-stream");
  18.         header("Content-Size: ".filesize($file));
  19.         header("Content-Disposition: attachment; filename=\"".$filename."\"");
  20.         header("Content-Length: ".filesize($file));
  21.         header("Content-transfer-encoding: binary");
  22.         @readfile($file);
  23.         exit;
  24.     }
  25. }
  26.  
  27. list($usec, $sec) = explode(' ', microtime());
  28. $_SESSION['start_time'] = ((float) $usec + (float) $sec);
  29.  
  30. $_SESSION['lang'] = isset($_SESSION['lang']) ? $_SESSION['lang']:'pl';
  31. $_REQUEST['page_1'] = isset($_REQUEST['page_1']) ? $_REQUEST['page_1']:'';
  32.  
  33. $_SESSION['dostep'] = 1;
  34. if ( isset($_REQUEST['page_1']) and $_REQUEST['page_1'] == '3w')
  35. {
  36.         $_SESSION['dostep'] = 1;
  37.         ?>
  38.         <script type="text/javascript">
  39.         javascript:location.replace('<?php echo ROOT?>')
  40.         </script>
  41.         <?php
  42. }
  43. if ( $_REQUEST['page_1'] == 'zamowienia' or (!isset($_SESSION['dostep']) and $_SERVER['REMOTE_ADDR'] <> '127.0.0.1') )
  44. {
  45.         include('inc/underconstruction.html');
  46.         die();
  47. }
  48.  
  49. function __autoload($class_name)
  50. {
  51.         if( file_exists('library/' . $class_name . '.class.php') )
  52.         {
  53.                 include ('library/' . $class_name . '.class.php');
  54.         }
  55.         elseif( file_exists('function/' . $class_name . '.class.php') )
  56.         {
  57.                 include ('function/' . $class_name . '.class.php');
  58.         }
  59.         elseif( file_exists('cms/function/' . $class_name . '.class.php') )
  60.         {
  61.                 include ('cms/function/' . $class_name . '.class.php');
  62.         }
  63.         else
  64.         {
  65.                 die(words::error_print('<span style="font-weight:bold">Nie można załadować klasy '.$class_name.'</span><br />Brak pliku '.$class_name.'.class.php'));
  66.         }
  67.         if ( !class_exists($class_name) )
  68.         {
  69.                 die(words::error_print('<span style="font-weight:bold">Brak klasy:</span> ' . $class_name));
  70.         }
  71.  
  72. }
  73. $main = new main;
  74. $main->stats();
  75. $main->set_define();
  76. $menu_id = $main->get_menu_id();
  77. $main->get_meta($menu_id);
  78.  
  79. $main->menu_build($menu_id);
  80. include ('inc/head.html');
  81. include ('inc/top.html');
  82. include ('inc/body.php');
  83. $main->menu_footer_build($menu_id);
  84. include ('inc/footer.html');
  85. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement