JSFiddle - React, Tailwind, and code Playground
HTML
<?php
include('mysql.php');
include('functions.php');
// Get random 2
$query="SELECT * FROM images ORDER BY RAND() LIMIT 0,2";
$result = @mysql_query($query);
while($row = mysql_fetch_object($result)) {
$images[] = (object) $row;
}
// Get the top10
$result = mysql_query("SELECT *, ROUND(score/(1+(losses/wins))) AS performance FROM images ORDER BY ROUND(score/(1+(losses/wins))) DESC LIMIT 0,10");
while($row = mysql_fetch_object($result)) $top_ratings[] = (object) $row;
// Close the connection
mysql_close();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Финашка</title>
<!--[if IE]>
<meta http-equiv="refresh" content="0;url=/ie.html">
<![endif]-->
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="960.css">
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.iphone-switch.js" type="text/javascript"></script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4ead349d421ea275"></script>
<script type="text/javascript" src="http://userapi.com/js/api/openapi.js?47"></script>
<script type="text/javascript">
VK.init({apiId: 1865074, onlyWidgets: true});
</script>
</head>
<body>
<div id="title"><a href="/index.php" rel="nofollow"></a></div>
<form METHOD=POST ACTION="rate.php">
<table width="auto" align="center">
<tr align="center" width="auto" valign="top">
<td><img class="shadow" src="images/<?=$images[0]->filename?>" /></td>
<td><img class="shadow" src="images/<?=$images[1]->filename?>" /></td>
</tr>
<tr>
<td><button type="submit" name="winner" value="<?=$images[0]->image_id?>">Vote for 1</button></td>
<td><button type="submit" name="winner"...