<html>
<head>
<title>Logging av brukere</title>
<link type="text/css" rel="stylesheet" title="Default"
href="../styles/main.css" />
</head>
<body>
<?
if(strstr($brukernavn,"xxxxxxxx") && strstr($passord,"xxxxxxxx"))
{
?>
<div align="center">
<h3>Sindrem</h3>
<?
$teller = 0;
$unike = 0;
$hostname = "xxxxxxxxxxxxxx";
$username = "xxxxxxxxxx";
$password = "xxxxxxxxxx";
$userstable = "xxxxxxxx";
$dbName = "xxxxxxxxxxxxxx";
MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to database");
@mysql_select_db( "$dbName") or die( "Unable to select database");
if (strstr($fra,"alle"))
{
$query = "SELECT * FROM $userstable WHERE side=1 ORDER BY referer LIMIT $start,10000";
}
else
{
$query = "SELECT * FROM $userstable WHERE side=1 ORDER BY referer LIMIT $start,$fra";
}
$result = MYSQL_QUERY($query);
$number = MYSQL_NUMROWS($result);
$i = 0;
$bgcolor = "";
PRINT "<table border=1 cellspacing=0 cellpadding=0 bgcolor=FFFFCC bordercolor=black>";
Print "<th>IP-adresse</th><th>Host</th><th>Browser</th><th>Tidspunkt/Dato</th><th>Språk</th>";
IF ($number == 0) :
PRINT "<CENTER><P>Ingen besøkende?</CENTER>";
ELSEIF ($number > 0) :
WHILE ($i < $number):
if($teller%2)
{
$bgcolor="#336666";
}
else
{
$bgcolor="#990066";
}
$ipaddress = mysql_result($result,$i,"ipaddress");
$host = mysql_result($result,$i,"host");
$browser = mysql_result($result,$i,"browser");
$referer = mysql_result($result,$i,"referer");
$sprak = mysql_result($result,$i,"sprak");
PRINT "<tr bgcolor=$bgcolor><td>$ipaddress</td><td>$host</td><td>$browser</td><td>$referer</td><td>$sprak</td></tr>";
$i++;
$unike ++;
$teller ++;
ENDWHILE;
PRINT "</table></CENTER>";
ENDIF;
echo "Antall unike besøkende: $unike <br>";
?>
<?
$countfile = file("../xxxxxxxxxxx.txt");
$count=$countfile[0];
echo "Antall besøkende: $count";
?>
</div>
<?
}
?>
<form method=get action="ut.php"><br>
<input type="text" name="brukernavn"><br>
<input type="text" name="passord"><br>
<select class="tekstfelt" name="start">
<option value="0" selected>Fra 0
<option value="10">10
<option value="20">20
<option value="30">30
<option value="40">40
</select>
<select class="tekstfelt" name="fra">
<option value="10">10
<option value="20">20
<option value="30" selected>Til 30
<option value="40">40
<option value="alle">Alle
</select>
<br>
<br>
<input class="knapp" type="Submit" value="Vis poster ->">