Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
$c = $row[cool];
$s = $row[sux];
if ($c > $s){
$result = $c - $s;
} else {
$result = $s - $c;
}
if ($result == 0){
$result = 50;
}
echo "
<div style='background-image: url(f2.gif); width: 100px;'>
<img src='f1.gif' style='width: $result%; height: 20px;'>
</div>$result %
"
$c = $row[cool];
$s = $row[sux];
if ($c > $s){
$result = $c - $s;
} else {
$result = $s - $c;
}
if ($result == 0){
$result2 = 50;
}
echo "
<div style='background-image: url(f2.gif); width: 100px;'>
<img src='f1.gif' style='width: $result2%;'>
</div>$result2 %
"
<?php
include "config.php";
$getid = (int)$_GET['id'];
if (isset($_GET['cool'])){
$add = mysql_query("UPDATE fpic SET cool=cool+1 where id='$getid]'") or die (mysql_error());
} else if (isset($_GET['sux'])){
$add2 = mysql_query("UPDATE fpic SET sux=sux+1 where id='$getid'") or die (mysql_error());
}
if($_GET['id']){
$sql = mysql_query("SELECT * FROM fpic ORDER BY RAND() LIMIT 1") or die (mysql_error());
while ($row=mysql_fetch_array($sql)){
$c = $row[cool];
$s = $row[sux];
if ($c > $s){
$result = $c - $s;
} else {
$result = $s - $c;
}
echo "
<title>$row[title]</title>
<img src='$row[picture]'><br>
<a href='?cool&id=$row[id]'>ЯКО е </a><br>
<a href='?sux&id=$row[id]'>Тъпо е </a><br>
Харесват я: $row[cool]<br>
Не я харесват: $row[sux]
<div style='background-image: url(f2.gif); width: 100px;'>
<img src='f1.gif' style='width: $result; height: 20px;'>
</div> $result %
";
}
}
?>
Не разбрах какво имаш в предвид под това "/всичко"яко_процент = яко/всичко * 100
тъпо_процент = тъпо/всичко * 100