PHP.SU
Программирование на PHP, MySQL и другие веб-технологии
|
|
Страниц (5): « 1 2 3 [4] 5 »
Найдено сообщений: 63 |
tsoi85 |
Отправлено: 09 Июля, 2011 - 15:54:43 • Тема: Графика в php • Форум: Графика в PHP |
Ответов: 35 Просмотров: 8481
|
Ещё вариант
Переменные:
$score - количество сейчас.
$max - максимальное количество.
PHP:
скопировать код в буфер обмена
echo ' <div class="hp"> <div class="hp_t"> <div class="hp_sc" style="width: '.sprintf('%d',$score/$max*100).'px;"> </div> </div> <div class="hp_b" title="'.sprintf('%02.1f',$score/$max*100).'%'.'"> <div class="hp_b_l">HP</div> <div class="hp_b_r">'.$score.' / '.$max.'</div> </div> </div> <div class="hp_cl"> </div>';
Стиль css (пути к картинкам измените на свои)
CODE ( html):
скопировать код в буфер обмена
.hp { width: 100px; height: 13px; color: #3d3d3d; background-color: #f2f2f2; overflow: hidden;} .hp_t { height: 13px; background: #fff url(pic2.png) repeat-x; font-size: 2px; } .hp_sc { height: 13px; background: #00f218 url(pic.png) repeat-x; font-size: 2px; } .hp_b { margin-top: -13px; height: 13px; text-align: right; font-size: 10px; } .hp_b_l { float: left; width: 20px; height: 13px; font-size: 10px; } .hp_b_r { float: right; width: 80px; height: 13px; font-size: 10px; } .hp_cl { clear: both; height: 1px; font-size: 1px; }
|
tsoi85 |
Отправлено: 09 Июля, 2011 - 01:02:01 • Тема: Графика в php • Форум: Графика в PHP |
Ответов: 35 Просмотров: 8481
|
Апострофы зачем? Они тут лишние.
... width: '$score px' ... |
tsoi85 |
Отправлено: 08 Июля, 2011 - 00:34:46 • Тема: autoupdate • Форум: HTTP и PHP |
Ответов: 7 Просмотров: 1974
|
Уберите .fadeIn("slow") |
tsoi85 |
Отправлено: 08 Июля, 2011 - 00:23:45 • Тема: Помогите пожалуйста с регуляркой • Форум: Регулярные выражения |
Ответов: 10 Просмотров: 493
|
Результат var_dump:
Спойлер (Отобразить)
CODE ( htmlphp):
скопировать код в буфер обмена
array(4) { [0]=> array(2) { [0]=> string(528) "<a href="/product/7766873/color/292847" class="product product-7766873 style-1496995 r0-17-2"> <img src="http://a2.zassets.com/images/z/1/4/9/1496995-p-LARGE_SEARCH.jpg" alt="adidas Running - CLIMACOOL® Oscillation W" /> <span class="brandName">adidas Running</span> <span class="productName">CLIMACOOL® Oscillation W</span> <span class="price">$75.00</span> <span class="flag"> <span class="new">NEW!</span> </span> <span class="quickViewMe btn secondary zgae-click*Search-Results-Page*Quick-View*Open">Quick View</span> </a>" [1]=> string(528) "<a href="/product/7766873/color/292848" class="product product-7766873 style-1496995 r0-17-2"> <img src="http://a2.zassets.com/images/z/1/4/9/1496995-p-LARGE_SEARCH.jpg" alt="adidas Running - CLIMACOOL® Oscillation W" /> <span class="brandName">adidas Running</span> <span class="productName">CLIMACOOL® Oscillation W</span> <span class="price">$75.00</span> <span class="flag"> <span class="new">NEW!</span> </span> <span class="quickViewMe btn secondary zgae-click*Search-Results-Page*Quick-View*Open">Quick View</span> </a>" } [1]=> array(2) { [0]=> string(29) "/product/7766873/color/292847" [1]=> string(29) "/product/7766873/color/292848" } [2]=> array(2) { [0]=> string(37) "product-7766873 style-1496995 r0-17-2" [1]=> string(37) "product-7766873 style-1496995 r0-17-2" } [3]=> array(2) { [0]=> string(430) " <img src="http://a2.zassets.com/images/z/1/4/9/1496995-p-LARGE_SEARCH.jpg" alt="adidas Running - CLIMACOOL® Oscillation W" /> <span class="brandName">adidas Running</span> <span class="productName">CLIMACOOL® Oscillation W</span> <span class="price">$75.00</span> <span class="flag"> <span class="new">NEW!</span> </span> <span class="quickViewMe btn secondary zgae-click*Search-Results-Page*Quick-View*Open">Quick View</span> " [1]=> string(430) " <img src="http://a2.zassets.com/images/z/1/4/9/1496995-p-LARGE_SEARCH.jpg" alt="adidas Running - CLIMACOOL® Oscillation W" /> <span class="brandName">adidas Running</span> <span class="productName">CLIMACOOL® Oscillation W</span> <span class="price">$75.00</span> <span class="flag"> <span class="new">NEW!</span> </span> <span class="quickViewMe btn secondary zgae-click*Search-Results-Page*Quick-View*Open">Quick View</span> " } }
|
tsoi85 |
Отправлено: 03 Июля, 2011 - 20:20:50 • Тема: Загрузка файла • Форум: HTTP и PHP |
Ответов: 11 Просмотров: 7181
|
PHP:
скопировать код в буфер обмена
if ($mime != "image/gif" and $mime !="image/jpeg" and $mime !="image/png" and $mime != "image/x-icon") { exit ("Доступна загрузка только gif, png, jpeg, jpg, ico файлов"); }
|
tsoi85 |
Отправлено: 02 Июля, 2011 - 17:40:51 • Тема: вывод scandir • Форум: Напишите за меня, пожалуйста |
Ответов: 5 Просмотров: 58
|
Vasiliya, с вашего позволения немного дополню:
PHP:
скопировать код в буфер обмена
$i = 0; $columns = 2; echo "<table>\n<tr>\n"; while($value = myCount()) { if ($value[0] != ".") { if ($i != 0 && ($i % $columns == 0)) echo "</tr>\n<tr>\n"; echo '<td width="150" style="color: '.((is_dir($dir.'/'.$value))? '#0000FF':'#FF0000').';">'.$value."</font></td>\n"; $i++; } } echo "</tr>\n</table>\n";
atem32,
global $dir,$data; - в восьмой строке не нужно |
tsoi85 |
Отправлено: 02 Июля, 2011 - 03:24:45 • Тема: Загрузка файла • Форум: HTTP и PHP |
Ответов: 11 Просмотров: 7181
|
$_POST['filename'] замените на $_POST['add'].
# В первой строке |
|
Страниц (5): « 1 2 3 [4] 5 »
Powered by ExBB FM 1.0 RC1. InvisionExBB
|
|