PHP.SU

Программирование на PHP, MySQL и другие веб-технологии
PHP.SU Портал     На главную страницу форума Главная     Помощь Помощь     Поиск Поиск     Поиск Яндекс Поиск Яндекс     Вакансии  Пользователи Пользователи

Страниц (1): [1]

> Найдено сообщений: 2
terminotor Отправлено: 11 Января, 2012 - 15:59:42 • Тема: В чем ошибка? • Форум: Кодировки и все смежное

Ответов: 0
Просмотров: 1422
имею файл uslugy.php:
PHP:
скопировать код в буфер обмена
  1.  
  2. <?PHP
  3. include('db.php');
  4. $rusult_db = mysql_query ("SELECT page_title,meta_d,meta_k,text FROM settings WHERE page_name='uslugy'",$db);
  5. $rusult_db_normal = mysql_fetch_array ($rusult_db);
  6. ?>
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  11. <meta http-equiv="Content-Style-Type" content="text/css" />
  12. <meta name="keywords" content="<?PHP echo $rusult_db_normal['meta_k']; ?>" />
  13. <meta name="description" content="<?PHP echo $rusult_db_normal['meta_d']; ?>" />
  14. <title><?PHP echo $rusult_db_normal['page_title']; ?></title>
  15.  
  16. <link href="style.css" rel="stylesheet" type="text/css" />
  17. <!-- Движение фон -->
  18. <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
  19. <script type="text/javascript" src="js/custom.js"></script>
  20. <!-- Движение фон -->
  21.  
  22. <!--Begunok -->
  23. <script type="text/javascript" src="Begunok/jscroller-0.4.js"></script>
  24. <script type="text/javascript">
  25.  
  26. $(document).ready(function(){
  27.  
  28.  
  29.  
  30. // Add Scroller Object
  31.  
  32. $jScroller.add("#scroller_container","#scroller","left",15);
  33.  
  34.  
  35.  
  36.        
  37.  // Start Autoscroller
  38.  
  39.           $jScroller.start();
  40.  
  41.           });
  42.  
  43.   </script>
  44.   <!--Begunok -->
  45.  
  46. <!-- Начало меню -->
  47.  
  48. <script>
  49.  
  50.  
  51.  
  52. $(document).ready(function()
  53.  
  54. {
  55. $.preloadImages = function()
  56.  
  57. {
  58. for(var i = 0; i<arguments.length; i++)
  59.  
  60.        {
  61.  
  62.                $("<img />").attr("src", arguments[i]);
  63.  
  64.        }
  65.  
  66. }
  67. $.preloadImages("images/toparrow.png","images/bottomarrow.png");
  68. var $top1= $('#floatingbar').offset().top + 20;  
  69. var $mid1 =  Math.floor($(window).height() / 2);
  70. $('#dirbutton').data('mode','scrollup');
  71. $('#dirbutton').click(function()
  72.  
  73. {
  74. $mode = $(this).data('mode');
  75. switch($mode)
  76.  
  77.    {
  78.  
  79.     case 'scrolldown':
  80.     $('html, body').animate({scrollTop:0}, 'slow');
  81.      return false;
  82.      break;
  83.  
  84.          case 'scrollup':
  85.  
  86.             $scrollpos = $('body').outerHeight();
  87.  
  88.             $('html, body').animate({scrollTop:$scrollpos}, 'slow');
  89.  
  90.                 return false;
  91.  
  92.                 break;
  93.  
  94.    }
  95. });
  96.  
  97. $(window).scroll(function()
  98.  
  99. {  
  100. if ($(window).scrollTop()>$top1)  
  101. {
  102. $('#floatingbar').addClass('floater');
  103. }
  104. else
  105. {
  106. $('#floatingbar').removeClass('floater');
  107. }
  108. if($(window).scrollTop() > $mid1)
  109. {
  110.  
  111.                      $('#dirbutton').find('img').attr('src','images/toparrow.png');
  112.  
  113.                          $('#dirbutton').data('mode','scrolldown');
  114.  
  115.                      $('#dirbutton').show();
  116.  
  117.                   }else
  118.  
  119.                   {        
  120.  
  121.                          $('#dirbutton').find('img').attr('src','images/bottomarrow.png');
  122.  
  123.                          $('#dirbutton').data('mode','scrollup');
  124.  
  125.                          
  126.  
  127.                   }
  128. });
  129. });
  130. </script>
  131. <!-- Начало меню -->
  132. </head>
  133.  
  134. <?PHP include('header.php');?>
  135.   <img src="images/shablon_web_c1_verh.png" />
  136.       <div id="content_1">
  137.      
  138.         <div id="c2_verh_v"><img src="images/shablon_web_c2_verh.png" /></div>
  139. <div id="content_2">
  140. <?PHP echo $rusult_db_normal['text']; ?>
  141. <?PHP
  142. $rusult_db_uslugy = mysql_query ("SELECT id,title,description FROM uslugy",$db);
  143. $rusult_db_uslugy_normal = mysql_fetch_array ($rusult_db_uslugy);
  144. do {
  145.   printf
  146.   ("<div>
  147.    <p><a href='uslugywiev.php?id=%s'><h2>%s</h2></a></p>
  148.  </div>
  149.    %s
  150.  <div>
  151.    
  152.  </div>",$rusult_db_uslugy_normal["id"],$rusult_db_uslugy_normal["title"],$rusult_db_uslugy_normal["description"]);
  153.    }
  154. while   ( $rusult_db_uslugy_normal=mysql_fetch_array ($rusult_db_uslugy));
  155. ?>
  156. </div>
  157. <div id="c2_niz"><img src="images/shablon_web_c2_niz.png" /></div>
  158.       </div>
  159.   <img src="images/shablon_web_c1_niz1.png" />
  160. <?PHP include('footer.php');?>
  161.  


И файл uslugywiev.php:
PHP:
скопировать код в буфер обмена
  1.  
  2. <?PHP include('db.php');
  3. if (isset ($_GET['id'])) {$id=$_GET['id'];}
  4. $rusult_db = mysql_query ("SELECT title,meta_d,meta_k,text FROM uslugy WHERE id='$id'",$db);
  5. $rusult_db_normal = mysql_fetch_array ($rusult_db);
  6. ?>
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  11. <meta http-equiv="Content-Style-Type" content="text/css" />
  12. <meta name="keywords" content="<?PHP echo $rusult_db_normal['meta_k']; ?>" />
  13. <meta name="description" content="<?PHP echo $rusult_db_normal['meta_d']; ?>" />
  14. <title><?PHP echo $rusult_db_normal['title']; ?></title>
  15. <link href="style.css" rel="stylesheet" type="text/css" />
  16. <!-- Движение фон -->
  17. <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
  18. <script type="text/javascript" src="js/custom.js"></script>
  19. <!-- Движение фон -->
  20. <!--Begunok -->
  21. <script type="text/javascript" src="Begunok/jscroller-0.4.js"></script>
  22. <script type="text/javascript">
  23.  
  24. $(document).ready(function(){
  25.  
  26.  
  27.  
  28. // Add Scroller Object
  29.  
  30. $jScroller.add("#scroller_container","#scroller","left",15);
  31.  
  32.  
  33.  
  34.        
  35.  // Start Autoscroller
  36.  
  37.           $jScroller.start();
  38.  
  39.           });
  40.  
  41.   </script>
  42.   <!--Begunok -->
  43.  
  44. <!-- Начало меню -->
  45.  
  46. <script>
  47.  
  48.  
  49.  
  50. $(document).ready(function()
  51.  
  52. {
  53. $.preloadImages = function()
  54.  
  55. {
  56. for(var i = 0; i<arguments.length; i++)
  57.  
  58.        {
  59.  
  60.                $("<img />").attr("src", arguments[i]);
  61.  
  62.        }
  63.  
  64. }
  65. $.preloadImages("images/toparrow.png","images/bottomarrow.png");
  66. var $top1= $('#floatingbar').offset().top + 20;  
  67. var $mid1 =  Math.floor($(window).height() / 2);
  68. $('#dirbutton').data('mode','scrollup');
  69. $('#dirbutton').click(function()
  70.  
  71. {
  72. $mode = $(this).data('mode');
  73. switch($mode)
  74.  
  75.    {
  76.  
  77.     case 'scrolldown':
  78.     $('html, body').animate({scrollTop:0}, 'slow');
  79.      return false;
  80.      break;
  81.  
  82.          case 'scrollup':
  83.  
  84.             $scrollpos = $('body').outerHeight();
  85.  
  86.             $('html, body').animate({scrollTop:$scrollpos}, 'slow');
  87.  
  88.                 return false;
  89.  
  90.                 break;
  91.  
  92.    }
  93. });
  94.  
  95. $(window).scroll(function()
  96.  
  97. {  
  98. if ($(window).scrollTop()>$top1)  
  99. {
  100. $('#floatingbar').addClass('floater');
  101. }
  102. else
  103. {
  104. $('#floatingbar').removeClass('floater');
  105. }
  106. if($(window).scrollTop() > $mid1)
  107. {
  108.  
  109.                      $('#dirbutton').find('img').attr('src','images/toparrow.png');
  110.  
  111.                          $('#dirbutton').data('mode','scrolldown');
  112.  
  113.                      $('#dirbutton').show();
  114.  
  115.                   }else
  116.  
  117.                   {        
  118.  
  119.                          $('#dirbutton').find('img').attr('src','images/bottomarrow.png');
  120.  
  121.                          $('#dirbutton').data('mode','scrollup');
  122.  
  123.                          
  124.  
  125.                   }
  126. });
  127. });
  128. </script>
  129. <!-- Начало меню -->
  130. </head>
  131.  
  132. <?PHP include('header.php');?>
  133.   <img src="images/shablon_web_c1_verh.png" />
  134.       <div id="content_1">
  135.      
  136.         <div id="c2_verh_v"><img src="images/shablon_web_c2_verh.png" /></div>
  137. <div id="content_2">
  138. <?PHP echo $rusult_db_normal['text']; ?>
  139.  
  140. </div>
  141. <div id="c2_niz"><img src="images/shablon_web_c2_niz.png" /></div>
  142.       </div>
  143.   <img src="images/shablon_web_c1_niz1.png" />
  144. <?PHP include('footer.php');?>
  145.  


Во второй передаются функции глобальной переменной $_GET и выводится нужная статья из базы данных.
Вопрос - первый файл отображается в браузере нормально, а у второго появляются отступы белого цвета сверху и снизу. Откуда? И как с ними бороться?
(Добавление)
Спасибо за внимание, я лох. Ошибка была элементарнейшей - заменил кодировку страницы с utf-8 на utf-8 без BOM Ха-ха
(Добавление)
Оказалось элементарно - заменить кодировку utf-8 на utf-8 без BOM Ха-ха Ха-ха всем спасибо
terminotor Отправлено: 05 Января, 2012 - 19:28:27 • Тема: Ошибка IE 8 • Форум: JavaScript & VBScript

Ответов: 1
Просмотров: 1580
Вот код страницы
CODE (text):
скопировать код в буфер обмена
  1.  
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta http-equiv="Content-Style-Type" content="text/css" />
  8.  
  9. <title>Документ без названия</title>
  10. <link href="style.css" rel="stylesheet" media="screen" type="text/css" />
  11. <!-- Движение фон -->
  12. <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
  13. <script type="text/javascript" src="js/custom.js"></script>
  14. <script type="text/javascript" src="js/pngFix.js"></script>
  15. <script type="text/javascript">
  16.  
  17.   DD_belatedPNG.fix('.png-fix');
  18.  
  19. </script>
  20. <!-- Движение фон -->
  21. <!-- Полный размер фон -->
  22. <script type="text/javascript">
  23. $(document).ready(function() {
  24.  
  25.  var bgImage = $('#container');      
  26.  
  27.     function resizeImg() {
  28.       var imgwidth = bgImage.width(),
  29.            imgheight = bgImage.height(),
  30.            winwidth = $(window).width(),
  31.            winheight = $(window).height(),
  32.            widthratio = winwidth / imgwidth,
  33.            heightratio = winheight / imgheight,
  34.            widthdiff = heightratio * imgwidth,
  35.            heightdiff = widthratio * imgheight;
  36.  
  37.       if(heightdiff>winheight) {
  38.         bgImage.css({
  39.           width: winwidth+'px',
  40.           height: heightdiff+'px'
  41.         });
  42.       } else {
  43.         bgImage.css({
  44.           width: widthdiff+'px',
  45.           height: winheight+'px'
  46.         });
  47.       }
  48.  
  49.      $("#container").show();
  50.  
  51.     }
  52.     resizeImg();
  53.     $(window).resize(function() {
  54.       resizeImg();
  55.     });
  56.  
  57. });
  58. </script>
  59.  
  60. <!-- Полный размер фон -->
  61. <!-- Начало меню -->
  62.  
  63. <script>
  64.  
  65.  
  66.  
  67. $(document).ready(function()
  68.  
  69. {
  70. $.preloadImages = function()
  71.  
  72. {
  73. for(var i = 0; i<arguments.length; i++)
  74.  
  75.        {
  76.  
  77.                $("<img />").attr("src", arguments[i]);
  78.  
  79.        }
  80.  
  81. }
  82. $.preloadImages("images/toparrow.png","images/bottomarrow.png");
  83. var $top1= $('#floatingbar').offset().top + 20;  
  84. var $mid1 =  Math.floor($(window).height() / 2);
  85. $('#dirbutton').data('mode','scrollup');
  86. $('#dirbutton').click(function()
  87.  
  88. {
  89. $mode = $(this).data('mode');
  90. switch($mode)
  91.  
  92.    {
  93.  
  94.     case 'scrolldown':
  95.     $('html, body').animate({scrollTop:0}, 'slow');
  96.      return false;
  97.      break;
  98.  
  99.          case 'scrollup':
  100.  
  101.             $scrollpos = $('body').outerHeight();
  102.  
  103.             $('html, body').animate({scrollTop:$scrollpos}, 'slow');
  104.  
  105.                 return false;
  106.  
  107.                 break;
  108.  
  109.    }
  110. });
  111.  
  112. $(window).scroll(function()
  113.  
  114. {  
  115. if ($(window).scrollTop()>$top1)  
  116. {
  117. $('#floatingbar').addClass('floater');
  118. }
  119. else
  120. {
  121. $('#floatingbar').removeClass('floater');
  122. }
  123. if($(window).scrollTop() > $mid1)
  124. {
  125.  
  126.                      $('#dirbutton').find('img').attr('src','images/toparrow.png');
  127.  
  128.                          $('#dirbutton').data('mode','scrolldown');
  129.  
  130.                      $('#dirbutton').show();
  131.  
  132.                   }else
  133.  
  134.                   {        
  135.  
  136.                          $('#dirbutton').find('img').attr('src','images/bottomarrow.png');
  137.  
  138.                          $('#dirbutton').data('mode','scrollup');
  139.  
  140.                          
  141.  
  142.                   }
  143. });
  144. });
  145. </script>
  146. <!-- Начало меню -->
  147. </head>
  148. <body>
  149. <div id="container">
  150. <div id="overlay" class="png-fix">
  151. <div id="glavcontainer">
  152.          <!-- Начало меню -->
  153.          <div  id="floatingbar">
  154.  
  155.                  <ul>
  156.  
  157.                   <li><img border=0 src="images/rocketbar.png"></img></li>
  158.  
  159.                    <li><a href="../version2/demo_2.html"><button>Главная</button></a></li>
  160.  
  161.                    <li><a href=""><button class="default">О нас</button></a></li>
  162.  
  163.                    <li><a href="#service"><button class="default">Услуги</button></a></li>
  164.  
  165.                    <li><a href=""><button class="default">Цены</button></a></li>
  166.  
  167.                    <li><a href=""><button class="default">Блог</button></a></li>
  168.  
  169.                    <li><a href=""><button class="default">Контакты</button></a></li>
  170.  
  171.                    
  172.  
  173.                  </ul>
  174.  
  175.         </div>
  176.  
  177.          <!-- Начало меню -->
  178.          
  179.          <img src="images/shablon_logo_web.png" style="margin-top:10px" />
  180.    
  181.     </div>
  182.     </div>
  183.  
  184. </div>
  185.  
  186.  
  187.  
  188. </body>
  189. </html>
  190.  

IE 8 говорит следующее


Сведения об ошибке на веб-странице

Агент пользователя: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
штамп времени: Thu, 5 Jan 2012 20:37:16 UTC


Сообщение: Недопустимый аргумент.
Строка: 13
Символ: 461
Код: 0
URI-код: http://localhost/webster/js/pngFix[dot]js


Сообщение: Недопустимый аргумент.
Строка: 12
Символ: 12949
Код: 0
URI-код: http://localhost/webster/js/jquery-1[dot]3[dot]2[dot]min[dot]js


Сведения об ошибке на веб-странице

Агент пользователя: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
штамп времени: Thu, 5 Jan 2012 20:37:30 UTC


Сообщение: Недопустимый аргумент.
Строка: 13
Символ: 461
Код: 0
URI-код: http://localhost/webster/js/pngFix[dot]js


Сообщение: Недопустимый аргумент.
Строка: 12
Символ: 12949
Код: 0
URI-код: http://localhost/webster/js/jquery-1[dot]3[dot]2[dot]min[dot]js

Во всех других браузерах все отображается без проблем, куда копать?

Страниц (1): [1]
Powered by PHP  Powered By MySQL  Powered by Nginx  Valid CSS  RSS

 
Powered by ExBB FM 1.0 RC1. InvisionExBB