Location: PHPKode > scripts > Voting system > voting-system-61721/list.php
<table border=4><tr><th>Question</th><th>a</th><th>b</th><th>c</th><th>d</th></tr>
<?php
$users = array(
'username' => 'password',
);
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('HTTP/1.1 401 Unautorized');
header('www-authenticate: Basic realm="PHP Secured"');
exit('This page requires authentication');
}
if(!isset($users[$_SERVER['PHP_AUTH_USER']])) {
header('HTTP/1.1 401 Unautorized');
header('WWW-Authenticate: Basic realm="PHP Secured"');
exit('Unautorized!');
}
if ($users[$_SERVER['PHP_AUTH_USER']] != $_SERVER['PHP_AUTH_PW'])
{
header('HTTP/1.1 401 Unautorized');
header('WWW-Authenticate: Basic realm="PHP Secured"');
exit('Unautorized!');
}

include('database.php');
$query="SELECT * FROM results2";
$rez=mysql_query($query);
while ($row = mysql_fetch_array($rez))
{
  print "<tr><td>{$row['quest']}</td><td>{$row['a']}</td><td>{$row['b']}</td><td>{$row['c']}</td><td>{$row['d']}</td></tr>";
}
?>
</table>
Return current item: Voting system