PHP.SU

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

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

> Найдено сообщений: 32
dorofej85 Отправлено: 11 Декабря, 2011 - 08:31:21 • Тема: Проблема с кодировкой utf-8! Помогите разобраться, как ее сделать русской! • Форум: Кодировки и все смежное

Ответов: 26
Просмотров: 22510
Вот отображение русс

Логин: $USERNAME$
Ты здесь: $USER_REG_DAYS$-й день
РўРІРѕР№ IP:$IP_ADDRESS$
Профиль
Список пользователей
�зменить информацию
Отправить сообщение
Читать ЛС ($UNREAD_P

документ сохраняю в кодировке utf-8 без bom! Почему так! работаю с denwer!
dorofej85 Отправлено: 10 Декабря, 2011 - 13:33:16 • Тема: Уважаемые форумчане ! Помогите пожайлуста разобраться с ошибкой • Форум: Если скрипт не работает

Ответов: 3
Просмотров: 1865
Warning: Invalid argument supplied for foreach() in Z:\home\gavnovopros.ru\www\index.php on line 87 вот что выдает ! Что тольок не пропобовал ничего не помогает!
Вот сам код (далее укажу строку 87 отметив ее)
CODE (htmlphp):
скопировать код в буфер обмена
  1. <?php
  2.  
  3. /*
  4.  * Title: Facemash-Alike Script
  5.  * Author: Anders Moefelt / http://moefelt.dk
  6.  * Version: 1.0
  7.  *
  8.  * Great resources:
  9.  *
  10.  * 1) http://www.jasonhuber.net/the-social-network-rating-formula-elo/
  11.  * 2) http://www.imdb.com/title/tt1285016/
  12.  * 3) http://en.wikipedia.org/wiki/Mark_Zuckerberg
  13.  * 4) http://www.facebook.com/markzuckerberg
  14.  *
  15.  * Performance rating = [(Total of opponents' ratings + 400 * (Wins - Losses)) / score].
  16.  */
  17.  
  18. include('mysql.php');
  19. include('functions.php');
  20.  
  21.  
  22. // Get random 2
  23. $query="SELECT * FROM images ORDER BY RAND() LIMIT 0,15";
  24. $result = @mysql_query($query);
  25. while($row = mysql_fetch_object($result)) {
  26.         $images[] = (object) $row;
  27. }
  28.  
  29. // Get the top10
  30. $result = mysql_query("SELECT *, ROUND(score/(1+(losses/wins))) AS performance FROM images ORDER BY ROUND(score/(1+(losses/wins))) DESC LIMIT 0,10");
  31. while($row = mysql_fetch_object($result)) $top_ratings[] = (object) $row;
  32.  
  33.  
  34. // Close the connection
  35.  
  36.  
  37. ?>
  38. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  39. <html xmlns="http://www.w3.org/1999/xhtml">
  40. <head>
  41. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  42. <title>Facemash-Alike Script</title>
  43. <style type="text/css">
  44.  
  45. body, html {font-family:Arial, Helvetica, sans-serif;width:100%;margin:0;padding:0;text-align:center;}
  46. h1 {background-color:#600;color:#fff;padding:20px 0;margin:0;}
  47. a img {border:0;}
  48. td {font-size:11px;}
  49. .image {background-color:#eee;border:1px solid #ddd;border-bottom:1px solid #bbb;padding:5px;}
  50. </style>
  51. </head>
  52.  
  53. <body>
  54.  
  55.  
  56. <h1>FACEMASH-ALIKE!!</h1>
  57. <h3>Were we let in for our looks? No. Will we be judged on them? Yes.</h3>
  58. <h2>Who's hotter? Click to choose!!!!!!</h2>
  59.  
  60. <center>
  61. <table>
  62.         <tr>
  63.                 <td valign="top" class="image"><a href="rate.php?winner=<?=$images[0]->image_id?>&loser=<?=$images[1]->image_id?>"><img src="images/<?=$images[0]->filename?>" /></a></td>
  64.                 <td valign="top" class="image"><a href="rate.php?winner=<?=$images[1]->image_id?>&loser=<?=$images[0]->image_id?>"><img src="images/<?=$images[1]->filename?>" /></a></td>
  65.         </tr>
  66.         <tr>
  67.                 <td>Won: <?=$images[0]->wins?>, Lost: <?=$images[0]->losses?></td>
  68.                 <td>Won: <?=$images[1]->wins?>, Lost: <?=$images[1]->losses?></td>
  69.         </tr>
  70.         <tr>
  71.                 <td>Score: <?=$images[0]->score?></td>
  72.                 <td>Score: <?=$images[1]->score?></td>
  73.         </tr>
  74.         <tr>
  75.                 <td>Expected: <?=round(expected($images[1]->score, $images[0]->score), 4)?></td>
  76.                 <td>Expected: <?=round(expected($images[0]->score, $images[1]->score), 4)?></td>
  77.         </tr>
  78. </table>
  79. </center>
  80.  
  81. <h2>Top Rated!!!</h2>
  82. <center>
  83. <table>
  84.         <tr>
  85. 87 строка               <? foreach($top_ratings as $key => $image) : ?>
  86.                 <td valign="top" width="250" height="150" bgcolor="#000000">Score: <?=$image->filename?></td>
  87.                 <? endforeach ?>
  88.         </tr>
  89.        
  90.         <?php /* Remove this to see the scoring
  91.         <tr>
  92.                 <? foreach($top_ratings as $key => $image) : ?>
  93.                 <td valign="top">Score: <?=$image->score?></td>
  94.                 <? endforeach ?>
  95.         </tr>
  96.         <tr>
  97.                 <? foreach($top_ratings as $key => $image) : ?>
  98.                 <td valign="top">Performance: <?=$image->performance?></td>
  99.                 <? endforeach ?>
  100.         </tr>
  101.         <tr>
  102.                 <? foreach($top_ratings as $key => $image) : ?>
  103.                 <td valign="top">Won: <?=$image->wins?></td>
  104.                 <? endforeach ?>
  105.         </tr>
  106.         <tr>
  107.                 <? foreach($top_ratings as $key => $image) : ?>
  108.                 <td valign="top">Lost: <?=$image->losses?></td>
  109.                 <? endforeach ?>
  110.         </tr>
  111.         */ ?>
  112. </table>
  113. </center>
  114.  
  115. </body>
  116. </html>

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

 
Powered by ExBB FM 1.0 RC1. InvisionExBB